Selenium RC popup window question
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!
精彩评论