0

I'm trying to start Edge browser with Java Selenium:

if(browser.equals("edge")) {
System.setProperty("webdriver.edge.driver", driverPath+"\\MicrosoftWebDriver\\MicrosoftWebDriver.exe");
driver = new EdgeDriver();
}

but i have this exception: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

[11:25:55.747] - Listening on http://localhost:25602/ 

[Ljava.lang.StackTraceElement;@4d98e41b
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '4.0.0-alpha-6', revision: '5f43a29cfc'
System info: host: 'EB00477', ip: '192.168.6.214', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '14.0.1'
Driver info: driver.version: EdgeDriver
Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '4.0.0-alpha-6', revision: '5f43a29cfc'
System info: host: 'EB00477', ip: '192.168.6.214', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '14.0.1'
Driver info: driver.version: EdgeDriver

My Edge version is:Microsoft Edge 44.18362.449.0,Microsoft EdgeHTML 18.18363

enter image description here

I tried using both MicrosoftWebDriver.exe and msedgedriver.exe file, they don't work. How can I make it work?

CCC
  • 170
  • 1
  • 15

1 Answers1

0

It looks like that the code is ok, while WebDriver and Edge versions were not matching. I installed Edge from https://www.microsoft.com/it-it/edge then I went to https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ and downloaded the correct Driver version. I have to use msedgedriver.exe

My code is:

if(browser.equals("edge")) {
System.setProperty("webdriver.edge.driver", driverPath+"\\MicrosoftWebDriver\\msedgedriver.exe");
driver = new EdgeDriver();
}
CCC
  • 170
  • 1
  • 15
  • Thanks for posting the solution for this issue. You can mark your answer as an accepted answer. It can help other community members in future in similar kind of issues. Thanks for your understanding. – Yu Zhou Aug 10 '20 at 01:22