My Code to launch Browser:
System.setProperty("webdriver.edge.driver", "C:\\selenium-drivers\\MicrosoftWebDriver.exe");
DesiredCapabilities capabilities = new DesiredCapabilities("MicrosoftEdge", "", Platform.WINDOWS);
driver = new EdgeDriver(capabilities);
driver.navigate().to("https://xyz.com");
driver.manage().window().maximize();
Browser & System Info:
- Edge Browser Version: 25.10586.0.0
System Info:
- Edition: Windows 10 Pro
- Version: 1511
- OS Build: 10586.420
Selenium Version:
- 2.53.0
Driver:
I tried using both "10240" & "10585" versions of WebDriver but keep getting below error. The edge browser does launch & dies with below error :
Reason for Failure: Unknown error (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 5.03 seconds Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40' System info: host: 'shaider-Win10', ip: '10.0.181.141', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91' Driver info: org.openqa.selenium.edge.EdgeDriver
Click Me to Show/Hide the Full Stack Trace
org.openqa.selenium.WebDriverException: Unknown error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 5.03 seconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
System info: host: 'shaider-Win10', ip: '10.0.181.141', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
Driver info: org.openqa.selenium.edge.EdgeDriver at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at
java.lang.reflect.Constructor.newInstance(Constructor.java:423) at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249) at
org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131) at
org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144) at
org.openqa.selenium.edge.EdgeDriver.(EdgeDriver.java:152) at
org.openqa.selenium.edge.EdgeDriver.(EdgeDriver.java:120) at
com.pageobjects.BaseClass.LaunchBrowser(BaseClass.java:196) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at
java.lang.reflect.Method.invoke(Method.java:498) at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at
org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510) at
org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211) at
org.testng.internal.Invoker.invokeMethod(Invoker.java:585) at
org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816) at
org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124) at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at
org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at
org.testng.TestRunner.privateRun(TestRunner.java:774) at
org.testng.TestRunner.run(TestRunner.java:624) at
org.testng.SuiteRunner.runTest(SuiteRunner.java:359) at
org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354) at
org.testng.SuiteRunner.privateRun(SuiteRunner.java:312) at
org.testng.SuiteRunner.run(SuiteRunner.java:261) at
org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at
org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at
org.testng.TestNG.runSuitesSequentially(TestNG.java:1215) at
org.testng.TestNG.runSuitesLocally(TestNG.java:1140) at
org.testng.TestNG.run(TestNG.java:1048) at
org.testng.TestNG.privateMain(TestNG.java:1355) at
org.testng.TestNG.main(TestNG.java:1324)
Any help will be greatly appreciated.
-
I had the exact same issue (unknown error). A colleague with the latest build (13494 or so) gets it running. You should try asking on the official EdgeDriver forum.FDM– FDM2017年04月15日 13:49:11 +00:00Commented Apr 15, 2017 at 13:49
2 Answers 2
As per my opinion, most of the engineers in QA companies are creating a script on Chrome and other browsers, as Selenium web driver has some issue with EDGE browser in locating the web elements. Further, I have tried to run on EDGE browser and it is working fine on my machine.
Below is the code to launch on EDGE browser:
import org.openqa.selenium.edge.EdgeDriver;
System.setProperty("webdriver.edge.driver",""MicrosoftWebdriver.exe path in your machine");
WebDriver driver = new EdgeDriver();
driver.get("your link");
Note: Make sure that your system installed with MicrosoftWebdriver.
Below are the Browser and System Info:-
EDGE Browser Version:25.10586.672.0
OS: Windows 10 Pro
Selenium Version:2.53
You can dynamically download edge driver and use like this. Please modify code according to your need, i tried my best to give answer according to your question with easy way.
config.properties
edgeDriverURL=https://download.microsoft.com/download/F/8/A/F8AF50AB-3C3A-4BC4-8773-DC27B32988DD/MicrosoftWebDriver.exe#17134
Java code:
if (ConfigProperties.getStringProperty("browser").contains("edge")) {
driverVersion = ConfigProperties.getStringProperty("edgeDriverURL").split("#")[1];
driverDirectory = ConfigProperties.getBaseDirectory() + "/conf/" + OperatingSystem.getOSType().toString().toLowerCase() + "/" + ConfigProperties.getStringProperty("browser") + "/" + driverVersion;
switch (OperatingSystem.getOSType()) {
case WINDOWS10: default:
driverFile = "MicrosoftWebDriver.exe";
driverFilePath = driverDirectory + "/" + driverFile;
try {
driverURL = new URL(ConfigProperties.getStringProperty("edgeDriverURL").split("#")[0]);
driverBinary = new File(driverFilePath);
} catch (MalformedURLException e1) {
e1.printStackTrace();
}
break;
}
try {
if (!driverBinary.exists() && !driverBinary.isFile()) {
setupDir(driverDirectory);
downloadFile(driverURL, driverDirectory, driverFile);
}
} catch (IOException e) {
e.printStackTrace();
}
System.setProperty("webdriver.edge.driver", driverFilePath);
webDriver = new EdgeDriver();
Dimension dimension = new Dimension(500, 500);
webDriver.manage().window().setSize(dimension);
webDriver.manage().window().maximize();
Explore related questions
See similar questions with these tags.