本文介绍了当我最小化Edge浏览器窗口时,MicrosoftWebDriver 16299、15063不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用MicrosoftWebDriver for Edge执行测试时,一切正常,但是当我最小化窗口时,所有测试均失败. Edge或MicrosoftWebDriver是否有任何避免这种行为的选项?

When I execute tests using MicrosoftWebDriver for Edge all works fine, but when I minimise the window all tests become failed. Does Edge or MicrosoftWebDriver have any options to avoid that behavior?

推荐答案

在尝试执行测试执行时,您一直在尝试最小化 浏览器窗口 进行中,它将违反所有最佳实践.值得一提的是,由于 Selenium 模拟了 User Actions ,因此 Selenium 需要 Browser 重点.如果 focus 丢失了,则 Selenium 将无法执行代码行.在您执行 Test Execution 时,请考虑以下步骤:

As you have been trying to minimise the Browser Window while your Test Execution is In Progress it will be against all the Best Practices. At this point it is worth to mention that as Selenium mocks the User Actions hence Selenium needs Browser focus. If the focus is lost Selenium won't be able to execute the lines of code. Consider the following steps while your Test Execution :

  • 浏览器最大化:执行测试时,请始终保持 Web浏览器最大化,以便大多数元素位于 视口
  • 按照最佳做法,您应该尝试在隔离的测试环境中执行您的测试脚本/自动化框架 手动干预,其中包含所有必需的软件硬件配置和设置.

  • Browser Maximize : While you execute your tests always keep the Web Browser maximized so majority of the elements are within the Viewport
  • As per best practices, you should try to execute your Test Scripts / Automation Framework in an isolated Test Environment away from Manual Intervention with all the required Software and Hardware configurations and setup.

您可以在

您还可以选择使用 Headless 版本的 Google Chrome Mozilla Firefox .

You also have an option to use Google Chrome or Mozilla Firefox in Headless version.

对于 Firefox ,您可以在

对于 Chrome ,您可以在

对于 Ghost浏览器,您可以在

这篇关于当我最小化Edge浏览器窗口时,MicrosoftWebDriver 16299、15063不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 10:28