2
votes

I have recently updated my selenium libraries from 2.46.0 to 2.53.0 (the most recent) in order to run tests on a Windows 10 machine with the Edge browser.

I have added this to my tests' setup phase to initialize the webdriver as an EdgeDriver:

System.setProperty("webdriver.edge.driver", driverDir+"MicrosoftWebDriver.exe");
DesiredCapabilities capabilities = new DesiredCapabilities("MicrosoftEdge", "", Platform.WINDOWS);
driver = new EdgeDriver(capabilities);

the "driver" field being an object of the WebDriver class.

This successfully starts the Edge browser but, the url that I attempt to get never gets used.

I have tried both drivers that Microsoft has to offer for this browser found here

Here is the "About this app" section of the settings to show the version: enter image description here

I can successfully load the page manually using the browser that was launched automatically.

Letting the test cases fail on hudson, I was given this stack trace in the console window:

15:13:04      [junit] Unknown error (WARNING: The server did not provide any stacktrace information)
15:13:04      [junit] Command duration or timeout: 100.28 seconds
15:13:04      [junit] Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
15:13:04      [junit] System info: host: 'DESKTOP-7LLLD31', ip: '172.16.4.159', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.7.0_51'
15:13:04      [junit] Driver info: org.openqa.selenium.edge.EdgeDriver
15:13:04      [junit] org.openqa.selenium.WebDriverException: Unknown error (WARNING: The server did not provide any stacktrace information)
15:13:04      [junit] Command duration or timeout: 100.28 seconds
15:13:04      [junit] Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
15:13:04      [junit] System info: host: 'DESKTOP-7LLLD31', ip: '172.16.4.159', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.7.0_51'
15:13:04      [junit] Driver info: org.openqa.selenium.edge.EdgeDriver
15:13:04      [junit]   at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
15:13:04      [junit]   at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
15:13:04      [junit]   at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
15:13:04      [junit]   at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
15:13:04      [junit]   at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
15:13:04      [junit]   at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
15:13:04      [junit]   at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144)
15:13:04      [junit]   at org.openqa.selenium.edge.EdgeDriver.(EdgeDriver.java:152)
15:13:04      [junit]   at org.openqa.selenium.edge.EdgeDriver.(EdgeDriver.java:120) 

I am not sure what is going on here, anything will help, thanks.

2
Does this happen with all the URLs ?Mad Piranha

2 Answers

0
votes

It looks like it is failing to instantiate a new version of the driver. From the stack it also seems to think the operating system is Windows 8 but that might be a bug in Selenium per this line:

'DESKTOP-7LLLD31', ip: '172.16.4.159', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.7.0_51'

One thing to note is you should always use a matching build of Windows/Microsoft Edge/Microsoft WebDriver. So per your screenshot you are on version 10586 of Windows/Microsoft Edge and should be using build 10586 of the driver which is located here: Microsoft WebDriver Fall 2015 Update

If you are in fact on Windows 10 and running it and seeing this issue then the next area to look at might be capabilities. Try creating an instance without passing in any capabilities and see if that works. If a capability you pass in is required and ends up being incorrect it will cause the creation of the instance of WebDriver to fail.

0
votes

I had also faced this issue where the Edge Browser was getting opened. But it wasn't loading the website URL and got auto-closed.

I tried this with Selenium 3.0 Beta2 and Windows 10. I got this issue because I was using incorrect version of MicrosoftWebDriver.exe. When I used the correct version of the webdriver, then this issue got rectified.

I used the below steps to resolve this issue -

  1. Go to Start > Settings > System > About and note down the OS Build number.

  2. Download the proper version of the driver from this link - https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

  3. If the file that's downloaded is .msi, then install it to get the .exe driver. For one of the release, direct .exe can be downloaded.

Sample Script that I used is given below -

System.setProperty("webdriver.edge.driver","C:\\Program Files (x86)\\Microsoft Web Driver\\MicrosoftWebDriver.exe"); //put actual location
WebDriver driver = new EdgeDriver();
driver.get("your link");

You can refer this article, if you want to see the detailed steps - http://automationtestinghub.com/selenium-3-launch-microsoft-edge-with-microsoftwebdriver/