How to work while Selenium tests are working(Selenium 测试工作时如何工作)
问题描述
当我编写自动化测试并运行它们(在我的 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.
这篇关于Selenium 测试工作时如何工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Selenium 测试工作时如何工作


基础教程推荐
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 将 XML 转换为通用列表 2022-01-01