NoSuchWindowException after Close Window

为君一笑 提交于 2019-12-11 18:18:48

问题


I'm using robotframework with the Selenium2Library. And i've been having some trouble on handling popup windows in IE8.

Try Popup
    Open Browser To PageXYZ
    Click Element  XYZ
    Select Window name=POPUPXYZ
    Page Should Contain  X
    Page Should Contain  Y
    Page Should Contain  Z
    Close Window
    Get Window Identifiers

Any command I use after the 'Close Window' fails and i get the same exception NoSuchWindowException.

(That shouldn't happen for the Get Window command IMO)

Any help?

Ty


回答1:


I agree with you that it should not happen but it does. From what I have seen, it is as if WebDriver needs a cool-off period (Sleeps will get rid of the error). As a workaround I use Wait Until Keyword Succeeds in combination with a Selenium2Library keyword that should pass before I resume testing.



来源:https://stackoverflow.com/questions/16687499/nosuchwindowexception-after-close-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!