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?
((JavascriptExecutor) webDriver).executeScript("window.focus();");
should do the trick!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With