How to Fix Microsoft Edge WebDriver Unknown Error

Reading time icon 3 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

microsoft edge webdriver unknown error

If you’re a developer, you might’ve encountered Microsoft Edge WebDriver unknown error a couple of times on your PC.

This error will interrupt your workflow and cause issues while developing your app, but there’s a way to fix this problem, and today we’re going to show you how to do that.

How can I fix Microsoft Edge WebDriver unknown error?

1. Install WebDriver manually

  1. Press Windows Key + S and enter optional. Select Manage optional features from the list of results.
    manage optional features microsoft edge webdriver unknown error 
  2. Click the Add a feature button.
    add a feature microsoft edge webdriver unknown error
  3. Select Microsoft WebDriver and click the Install button.
    install microsoft webdriver microsoft edge webdriver unknown error

Once the driver is installed you just need to add the following code to your project:

var driver = new EdgeDriver("C:\\Windows\\System32\\", edgeOptions);

2. Remove static modifier

  1. Open your project.
  2. Now locate the WebDriver initialization and change it like this:

IWebDriver Edge = new EdgeDriver();

After making these changes, the Microsoft Edge WebDriver unknown error should be gone.

3. Stop all corresponding instances

stop instances microsoft edge webdriver unknown error
  1. Open your project.
  2. Now add this code:

foreach (var process in System.Diagnostics.Process.GetProcessesByName("MicrosoftWebDriver"))

{

    process.Kill();

}

Save changes and check if that solves your problem.

4. Pass the executable_path argument

  1. Open your project.
  2. Add the following line of code:

browser = webdriver.Edge(executable_path=r'C:\ALTIUM_WORK\Altium_Python\MicrosoftWebDriver.exe')

Keep in mind that this solution works only with Python scripts.

Few users reported that this method works only if User Account Control is enabled, and you can do that by following these steps:

  1. Press Windows Key + S and enter the user account. Select Change User Account Control settings from the search results.
     change user account control settings microsoft edge webdriver unknown error
  2. Move the slider to the recommended position and click OK to save changes.
    adjust user account control settings microsoft edge webdriver unknown error
  3. Restart your computer.

After doing that, the problem with the WebDriver will be resolved.

5. Use the verbose parameter

verbose paramter microsoft edge webdriver unknown error
  1. Open Command Prompt and run the following command:
     msedgedriver.exe --verbose 
  2. Now run the script normally in other Command Prompt:

const Selenium = require("selenium-webdriver");

const BROWSER_NAME = Selenium.Browser.EDGE;

const builder = new Selenium.Builder().forBrowser(BROWSER_NAME)

.withCapabilities({

        "browserName": 'MicrosoftEdge',

        "browserVersion": '81.0',

        "platformName": 'Windows 10',

        'ms:edgeChromium': true

    }).usingServer('http://localhost:9515')

const driver = builder.build()

Keep in mind that this solution works only if you’re using Selenium.

To learn more about similar errors, our Troubleshooting ‘WebDriver Cannot be Resolved’ – Step-by-step guide should provide you with useful information.

This error is similar to the one mentioned in our Driver cannot be resolved in Selenium guide, so you might want to check it out for more solutions.

Microsoft Edge WebDriver unknown error message can cause a lot of problems for the developers, but you should be able to fix it using our solutions.

More about the topics: Microsoft Edge issues

User forum

0 messages