1

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();
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Try using chrome? – Zakk Diaz Dec 24 '19 at 16:52
  • 1
    The issue occurs because you're using the Microsoft WebDriver version not matching the Microsoft Edge browser version. Microsoft WebDriver for Microsoft Edge version 18 is a Windows Feature on Demand. I'm in favor of DebanjanB's answer and you could try the steps in his solution. – Yu Zhou Dec 25 '19 at 02:05

1 Answers1

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
      

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

  • 64 bit:

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

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

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.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 1
    Thank you @DebanjanB. I was able to install the "WebDriver" by following your installation steps and was able to run the Automation test through the Edge browser. – Abinash Giri Dec 31 '19 at 16:32