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

查看:391
本文介绍了Microsoft Web驱动程序已停止工作.问题导致程序在Selenium中使用EdgeDriver和Microsoft Edge停止正常运行错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How do I run Microsoft Edge in Selenium. Each time I run a test, the Edge browser opens but does not load any URL. It then displays a small dialog box with the text:

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
  • 硒支持版本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 Browser 会话.

...implies that the MicrosoftWebDriver was unable to initiate/spawn a new Browsing Context i.e. Microsoft Edge Browser session.

根据 Windows按需功能(FoD),以确保它始终自动保持最新状态,并启用了一些获取Microsoft WebDriver的新方法.

As you are using Microsoft Edge Browser Version 18.17763, as per the documentation in Enhancing automated testing in Microsoft Edge with new WebDriver capabilities, W3C protocol support, and automatic updates, now MicrosoftWebDriver is a Windows Feature on Demand (FoD), which ensures that it’s always up to date automatically, and enables some new ways to get Microsoft WebDriver.

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

  • Enable Developer Mode which will install the appropriate version of WebDriver.

Open Settings app > Go to Update & Security > For Developer and then select "Developer Mode".

  • 您还可以通过以下两种方式之一安装独立版本的WebDriver:

  • You can also install a standalone version of WebDriver in one of two ways:

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

    • Search "Manage optional features" from Start, then select "Add a Feature", "WebDriver".
    • Install via DISM by running the following command in an elevated command prompt:

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

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

    Note: When installing MicrosoftWebDriver through the DISM command, by default the webdriver is installed within the following sub-directories:

    • 64位:

    • 64 bit:

    C:\\Windows\\SysWOW64\\MicrosoftWebDriver.exe
    

  • 32位:

  • 32 bit:

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

  • 按照 Microsoft Edge开发人员指南:

    EdgeHTML 18包括Microsoft Edge平台的当前版本中自 Windows Insider 预览版本的更改,请参见

    EdgeHTML 18 includes the following new and updated features shipped in the current release of the Microsoft Edge platform, as of the Windows 10 October 2018 Update (10/2018, Build 17763). For changes in specific Windows Insider Preview builds, see the Microsoft Edge Changelog and What's New in EdgeHTML.

    这篇关于Microsoft Web驱动程序已停止工作.问题导致程序在Selenium中使用EdgeDriver和Microsoft Edge停止正常运行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆