Use Edge WebDriver with Microsoft Edge Driver

Q

How to use Edge WebDriver with Microsoft Edge Driver?

✍: FYIcenter.com

A

If you are using the Edge WebDriver with the Selenium Java API, you need to set the webdriver.edge.driver system property to the path to the Microsoft Edge Driver as shown below.

1. Make sure that you have Microsoft Edge WebDriver Server installed:

C:\fyicenter>dir \fyicenter\selenium\edgedriver
         9,941,384 msedgedriver.exe

2. Set the webdriver.chrome.driver system property to the Microsoft Edge WebDriver server program path and run the test again.

C:\fyicenter> java -classpath \
   .;\fyicenter\selenium\java\client-combined-3.141.59.jar;\
   \fyicenter\selenium\java\libs\guava-25.0-jre.jar;\
   \fyicenter\selenium\java\libs\okhttp-3.11.0.jar;\
   \fyicenter\selenium\java\libs\okio-1.14.0.jar;\
   \fyicenter\selenium\java\libs\commons-exec-1.3.jar \
   -Dwebdriver.edge.driver=\fyicenter\selenium\edgedriver\msedgedriver.exe \
   EdgeTest

Starting MSEdgeDriver 76.0.174.0 (...) on port 24439
Only local connections are allowed.
Please protect ports used by the WebDriver and related test frameworks 
to prevent access by malicious code.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: 
   cannot find Microsoft Edge binary
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '12.0.1'
Driver info: driver.version: EdgeDriver
remote stacktrace: Backtrace:
   Ordinal0 [0x00007FF60DBF1FC2+1777602]
   ...

As you can see, we are getting a diffrent error: "cannot find Microsoft Edge binary". This is cause by the version compatibility issue between the Edge Driver and the Edge Browser. See next tutorial on how to fix it.

 

Match Microsoft Edge Driver version with Edge

Edge WebDriver Test with Selenium Java API

Starting with Selenium WebDriver Client Java API

⇑⇑ Selenium Tutorials

2020-01-29, 398👍, 0💬