How to bring browser to front using Selenium WebDriver?

孤人 提交于 2020-02-06 08:13:06

问题


I've a test where it handles login system popup using Robot of Java. But because of some issues, other applications or browser instance come to front and Robot could not perform actions on system popup of Windows.

Hence before interacting with system popup using Robot, I want to bring that browser to front on machine. I tried following but it did not help -

((JavascriptExecutor)driver).executeScript("window.focus();");

Could you please suggest how I can bring it to the front?

来源:https://stackoverflow.com/questions/59478471/how-to-bring-browser-to-front-using-selenium-webdriver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!