"Window does not exist" when returning from popup

View: New views
2 Messages — Rating Filter:   Alert me  

"Window does not exist" when returning from popup

by Ship :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Greetings - sorry if this has been answered already.... I couldn't find a solution that works.

I'm recording scripts in IDE and exporting to Java(Junit). Our app launches a popup window and I get the following error when returning from the popup:  

com.thoughtworks.selenium.SeleniumException: ERROR: Window does not exist.

Here's the script: (Note the two commented lines below did not resolve the problem).

                selenium.click("//input[@value='Current Alerts']");
                selenium.waitForPopUp("Alerts", "30000");
                selenium.selectWindow("name=Alerts");
                verifyTrue(selenium.isTextPresent("Our records show you are due for the following:"));
                selenium.click("link=Close this window");
// selenium.wait(30000);
// selenium.waitForPageToLoad("60000");
                selenium.selectWindow("name=null");
                selenium.click("link=Log off");
                selenium.waitForPageToLoad("60000");


Any ideas?

Thanks!

Re: "Window does not exist" when returning from popup

by Ship :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Found the solution  --  wrong syntax for the select.window statement (below). The following works:
selenium.selectWindow(null);



Ship wrote:
Greetings - sorry if this has been answered already.... I couldn't find a solution that works.

I'm recording scripts in IDE and exporting to Java(Junit). Our app launches a popup window and I get the following error when returning from the popup:  

com.thoughtworks.selenium.SeleniumException: ERROR: Window does not exist.

Here's the script: (Note the two commented lines below did not resolve the problem).

                selenium.click("//input[@value='Current Alerts']");
                selenium.waitForPopUp("Alerts", "30000");
                selenium.selectWindow("name=Alerts");
                verifyTrue(selenium.isTextPresent("Our records show you are due for the following:"));
                selenium.click("link=Close this window");
// selenium.wait(30000);
// selenium.waitForPageToLoad("60000");
                selenium.selectWindow("name=null");
                selenium.click("link=Log off");
                selenium.waitForPageToLoad("60000");


Any ideas?

Thanks!