选择没有标题的弹出窗口,然后单击geb中的按钮

时间:2016-10-18 11:18:38

标签: selenium testing geb

我有一个没有标题的弹出窗口,我想使用任何其他条件检测窗口(例如包装整个弹出窗口的div)并单击其中的按钮。

我尝试了以下内容:

        when:
            withWindow({ $("div", class:"main.msgAlert" )}) {

                $('#close').click()

        }
            then: true

但我总是在te #close行动中获得org.openqa.selenium.ElementNotVisibleException。 我是否未能检测到窗口或是否与按钮有关?

0 个答案:

没有答案