硒测试工作时如何工作 [英] How to work while Selenium tests are working
问题描述
当我编写自动化测试并在我的PC上运行它们时,直到测试完成,我才能工作,因为例如,如果我要编码,则焦点将跳出Visual Studio并转到被查看的Web应用程序在网络浏览器中.
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.
有没有一种方法可以防止Selenium驱动程序窃取焦点?
Is there a way to prevent Selenium driver from stealing focus?
推荐答案
不仅不能阻止WebdDiver
取得焦点,也不应该这样做. WebdDiver
需要将焦点放在浏览器上才能与之成功交互.如果您将焦点放在WebdDiver
上,将无法执行FindElement()
,Click()
之类的操作或任何其他操作,并且测试将失败.
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.
这篇关于硒测试工作时如何工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!