简体   繁体   中英

Selenium2 (WebDriver) using Java fails when browser window is not focused

My Selenium Java Webdriver tests are failing when they start if I don't click on the browser page that is being opened.

The following crash is caused from an ElementNotVisibleException , obviously.

This was not a big issue until now that I have to put them in a Jenkins CI machine.

Can any body help by providing possible solution or suggestion?

For Selenium RC:

selenium.windowFocus();
selenium.windowMaximize();

For WebDriver (Selenium 2):

driver.manage().window().maximize();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM