We are running Selenium regression tests against our existing code base, and certain screens in our web app use pop-ups for intermediate steps.
Currently we use the
I just trialled adding another selenium function, windowFocus():
// force new window to open at this point - so we can select it later
selenium().getEval("this.browserbot.getCurrentWindow().open('', 'enquiryPopup')");
selenium().click("//input[@value='Submit']");
selenium().windowFocus("enquiryPopup");
selenium().waitForPopUp("enquiryPopup", getWaitTime());
selenium().selectWindow("enquiryPopup");
The test succeeded when I ran it locally, but only with all those method calls - create/focus/wait/select.
I'm about to let the build server run all the tests, and if that succeeds too, I'll be making a library function out of it...!