IT Staff

Blog về chuyên ngành IT

Selenium FAQ Collection (2)

leave a comment »

1. Handling browser pop-up windows with Selenium

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 commands in the test:

// 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().waitForPopUp("enquiryPopup", getWaitTime()); selenium().selectWindow("enquiryPopup"); 

…which works most of the time. Occasionally the test will fail on the waitForPopUp() line with

com.thoughtworks.selenium.SeleniumException: Permission denied 

Can anyone suggest a better, more reliable method?

Also, we primarily run these tests on IE6 and 7

—-

Written by Xavier

May 8, 2012 at 4:58 am

Posted in Testing

Leave a comment