开发者

Selenium RC popup window question

开发者 https://www.devze.com 2022-12-21 04:05 出处:网络
My webpage submits information to a page and the response returns a popup window. Does anyone have an idea about how I can validate the informatio开发者_如何学Pythonn in the popup window?

My webpage submits information to a page and the response returns a popup window. Does anyone have an idea about how I can validate the informatio开发者_如何学Pythonn in the popup window?

Popup window doesn't have a WindowId and I'm not able to get hold of the popup window using selenium.GetWindow("popuwindowname"), selenium.GetWindow("title=something") or selenium.GetWindow("name=popupwindowname").

Has anyone had a similar problem and found a workaround or an alternative solution?


Can you put the html source of the popup window. Usually, what you see in the screen may different in the html code.


What type of popup dialog is returned if this is a modal dialog selenium does not handle modal dialogs.because a modal dialog stops all javascripts from running until it is closed. see Selenium FAQ


Try this

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();

Hope will help you!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号