Home > OS >  Selenium failing due to Edge webdriver exception
Selenium failing due to Edge webdriver exception

Time:01-12

Suddenly my selenium tests are failing due to this error:

System.InvalidOperationException : session not created: This version of Microsoft Edge WebDriver only supports Microsoft Edge version 106
Current browser version is 108.0.1462.76 with binary path C:\Program Files 
(x86)\Microsoft\Edge\Application\msedge.exe (SessionNotCreated)

The web browser im using is version 108.x. I also have the latest stable edge webdriver (same version as the browser). So why am i seeing this exception referring to edge version 106?

Note that I have the webdriver.exe (for version 108.x) in a folder under C:. This path is defined in the user's PATH under environment variables.

CodePudding user response:

I had the same message as yours but mine was in version 107 so it could be launched. Then, I searched for any redundant Edge Driver that I had installed and was in version 107. I successfully found it and after some modification Selenium worked as expected. Here's what I've done and you may have a try:

  1. Search for any redundant Edge Driver using keywords like "msedgedriver" or "MicrosoftWebDriver" (actually I used the latter to locate it).
  2. Pay attention to the version. In your case, you should delete those in 106.
  3. The test case should work afterwards. But if you are getting this error: The path to the driver executable must be set by the webdriver.chrome.driver system property, try renaming the driver as MicrosoftWebDriver. I was getting that error because my driver was named as msedgedriver. It seems that Java Selenium only (?) recognizes MicrosoftWebDriver.
  4. (workaround) If these steps cannot solve the issue for you, you can simply specify the driver location by System.setProperty("webdriver.edge.driver", "C:\\drivers\\msedgedriver.exe");
  • Related