3

我的网页向页面提交信息,响应返回一个弹出窗口。有人知道如何验证弹出窗口中的信息吗?

弹出窗口没有 aWindowId并且我无法使用 或 来获取selenium.GetWindow("popuwindowname")弹出selenium.GetWindow("title=something")窗口selenium.GetWindow("name=popupwindowname")

有没有人遇到过类似的问题并找到了解决方法或替代解决方案?

4

3 回答 3

0

如果这是一个模态对话框,则返回什么类型的弹出对话框 selenium 不处理模态对话框。因为模态对话框会阻止所有 javascripts 运行,直到它关闭。请参阅硒常见问题解答

于 2010-11-23T08:59:31.663 回答
0

能不能把弹窗的html源码放上来。通常,您在屏幕上看到的内容在 html 代码中可能会有所不同。

于 2010-11-20T13:59:45.157 回答
0

尝试这个

public void testPopup() throws Exception {
    selenium.open("http://yoursitename/page.aspx");
    selenium.click("//img[@alt='Share']");
    selenium.waitForPopUp("_blank", "30000");
    selenium.selectPopUp("");
    verifyTrue(selenium.isTextPresent("Recommend to a friend"));
    selenium.close();

希望能帮到你!

于 2010-12-10T07:11:48.513 回答