Skip to content

Switch Window seems to fail randomly even if it report PASS #1528

Open
@sbengo

Description

@sbengo

Hi guys,

We have started to use RF to automate web test and retrieve metrics from navigations.
Everything has been OK until we have to automate some IE9-prepared websites.

The website open several dialogs so we have to call Switch Window to change window context and continue the test.

We are using the following KWs to force (with 2 retries) a Switch Window that it has been correctly opened, but, even if it reports as PASS, the window is not always switched, so the test fails

Robot

*** Test Cases ***
...

    ${status}	${value} =	Run Keyword And Ignore Error	    Open Dialog
    Run Keyword If	'${status}' == 'FAIL'   Run Keyword And Ignore Error   Open Dialog
    
    ${win_list}     Get Window Handles
    ${dialog_id}   Get From List   ${win_list}    2
    Switch Window   ${dialog_id}

....

*** Keywords ***
Open Dialog
    Click Element   xpath=(.//td[@id='myLocator'])
    Switch Window   NEW     10s

Logs

On the following gist you can find a real execution and how switch window report as pass but the window context is not really changed:

https://gist.github.com/sbengo/291164d42b68b69c42b5b7fdefbabded

  • Failed Open Dialog (x2 times) on Switch Window KW
  • New Window is being retrived, so it exists.
  • The Switch Window report as PASS but it really doesn't switch window context

So, there is another way to make a secure Switch Window?

Environment

Browser: IE 11 with compatibility mode (website prepared for IE9)
Browser driver: Remote Selenium Webdriver IE 32 bits

Libraries

  • Robot Framework: 3.1.1
  • SeleniumLibrary: 4.1.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions