0

我正在使用带有 Selenium2Library 的机器人框架。而且我在处理 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

我在“关闭窗口”后使用的任何命令都失败了,我得到了同样的异常 NoSuchWindowException。

(这不应该发生在 Get Window 命令 IMO 中)

有什么帮助吗?

4

1 回答 1

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.

于 2013-08-16T18:51:45.520 回答