Deepu
Deepu

Reputation: 113

Browser window going behind everything else when running selenium webdriver java scripts

I've an issue with my IE browser when running selenium WebDriver java scripts. For a while it will run in front of the screen, at some point of time it's going behind the screen and what ever other windows opened in the system comes to front. This is affecting the flow of the scripts run mostly. Can any one suggest a solution. Thanks !!!

Upvotes: 0

Views: 1727

Answers (2)

Deepu
Deepu

Reputation: 113

I've solved this issue to some extend by using window.focus() method. Where ever IE window goes behind the screen, we must use it to bring it back infront of the screen. Here's the code snippet ((JavascriptExecutor)driver).executeScript("window.focus()");

Thanks :)

Upvotes: 2

JimEvans
JimEvans

Reputation: 27496

There was a known issue with the IE window being pushed to the bottom of the Z-order (to the background) when doing certain operations with the IE driver. Among these were calling WebElement.click() and selecting elements in a <select> element. These issues were corrected in 2.26.0.9 of the IEDriverServer.exe. Updating both your language bindings and your IEDriverServer.exe to the latest version (2.28, at the time of this writing) will likely solve your issue.

Upvotes: 2

Related Questions