问题
When I write automated tests and run them (on my PC) I can not work until the tests are finished, because for example if I am coding the focus will jump out of visual studio to go to the web application under test viewed in web browser.
Is there a way to prevent Selenium driver from stealing focus?
回答1:
Not only you can't prevent the WebdDiver
from taking the focus, you shouldn't do it. The WebdDiver
needs the focus on the browser in order to successfully interact with it. If you take the focus the WebdDiver
won't be able to perform actions like FindElement()
, Click()
or any other operation and the tests will fail.
回答2:
You can use Windows 10 Virtual Desktops. Check here how to use it: https://www.howtogeek.com/197625/how-to-use-virtual-desktops-in-windows-10/
来源:https://stackoverflow.com/questions/42366866/how-to-work-while-selenium-tests-are-working