Make sure that browser opened by webdriver is always in focus

0
0

If the browser window is not in focus, all webdriver identifications on the current page fail.

How can the browser be brought into focus, using webdriver?

  • You must to post comments
0
0
((JavascriptExecutor) webDriver).executeScript("window.focus();");

should do the trick!

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website