Selenium 测试工作时如何工作

How to work while Selenium tests are working(Selenium 测试工作时如何工作)
本文介绍了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 测试工作时如何工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)