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 测试工作时如何工作
基础教程推荐
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- WPF 模态进度窗口 2022-01-01
