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

旧城冷巷雨未停 提交于 2020-02-05 06:54:18

问题


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

I am using:

  • Windows 10 OS 17763.914
  • Selenium.WebDriver.MicrosoftDriver version 17.17134.0
  • Selenium support Version 3.141.0
  • Selenium Web-driver version 3.141.0 and
  • Microsoft Edge Browser Version 18.17763.
  • It's N Unit Framework with C#.

Code trial:

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

回答1:


This error message...

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

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


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.

Steps

  • 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".
    
  • You can also install a standalone version of WebDriver in one of two ways:

    • 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
      

tl; dr

As per Microsoft Edge Developer Guide:

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.



来源:https://stackoverflow.com/questions/59471353/microsoft-web-driver-has-stopped-working-a-problem-cause-the-program-to-stop-wo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!