繁体   English   中英

Microsoft Web 驱动程序已停止工作。 在 Selenium 中使用 EdgeDriver 和 Microsoft Edge 导致程序停止正常工作的问题

[英]Microsoft Web Driver has stopped working. A problem cause the program to stop working correctly error using EdgeDriver and Microsoft Edge in Selenium

如何在 Selenium 中运行 Microsoft Edge。 每次运行测试时,Edge 浏览器都会打开,但不会加载任何 URL。 然后它会显示一个带有文本的小对话框:

Microsoft Web Driver has stopped working. A problem cause the program to stop working correctly. Please close the program

我在用:

  • Windows 10 操作系统 17763.914
  • Selenium.WebDriver.MicrosoftDriver 版本 17.17134.0
  • Selenium 支持版本 3.141.0
  • Selenium Web 驱动程序版本 3.141.0 和
  • Microsoft Edge 浏览器版本 18.17763。
  • 它是带有 C# 的 N 单元框架。

代码试用:

using OpenQA.Selenium.Edge;
driver = new EdgeDriver();

这个错误信息...

Microsoft Web Driver has stopped working. A problem cause the program to stop working correctly. Please close the program

...暗示MicrosoftWebDriver无法启动/生成新的浏览上下文,Microsoft Edge 浏览器会话。


当您使用Microsoft Edge Browser Version 18.17763 ,根据使用新的 WebDriver 功能、W3C 协议支持和自动更新增强 Microsoft Edge 中的自动化测试中的文档,现在 MicrosoftWebDriver 是Windows 按需功能 (FoD) ,可确保它是始终自动更新,并启用一些新方法来获取 Microsoft WebDriver。

脚步

  • 启用开发人员模式,这将安装适当版本的 WebDriver。

     Open Settings app > Go to Update & Security > For Developer and then select "Developer Mode".
  • 您还可以通过以下两种方式之一安装独立版本的 WebDriver:

    • 从开始搜索“管理可选功能”,然后选择“添加功能”、“WebDriver”。
    • 通过在提升的命令提示符中运行以下命令,通过 DISM 进行安装:

       DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0

注意:通过DISM命令安装MicrosoftWebDriver 时,默认情况下 webdriver 安装在以下子目录中:

  • 64 位:

     C:\\\\Windows\\\\SysWOW64\\\\MicrosoftWebDriver.exe
  • 32 位:

     C:\\\\Windows\\\\System32\\\\MicrosoftWebDriver.exe

tl; 博士

根据Microsoft Edge 开发人员指南

截至 2018 年 10 月 10 日Windows 更新(10/2018,内部版本 17763),EdgeHTML 18 包括以下 Microsoft Edge 平台当前版本中提供的新功能和更新功能。 有关特定Windows Insider Preview 版本的更改,请参阅Microsoft Edge 更改日志EdgeHTML 中的新增功能

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM