The selenuim server 3.141.59 node failed to create a new service for Microsoft Edge (Chromium)
_Prerequisite:_
_Steps to reproduce the behavior:_
'nodeConfig.json' file:
{
"capabilities":
[
{
"browserName": "MicrosoftEdge",
"maxInstances": 5,
"seleniumProtocol": "WebDriver",
"webdriver.edge.driver": "msedgedriver"
}
],
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 20,
"port": -1,
"register": true,
"registerCycle": 5000,
"hub": "http://localhost:4444",
"nodeStatusCheckTimeout": 5000,
"nodePolling": 5000,
"role": "node",
"unregisterIfStillDownAfter": 60000,
"downPollingLimit": 5,
"debug": false,
"servlets" : [],
"withoutServlets": [],
"custom": {}
}
@Test
public void edgeTest() throws InterruptedException, MalformedURLException {
EdgeOptions options = new EdgeOptions();
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), options);
driver.get("https://www.selenium.dev/");
}
The test fails with the below error
**org.openqa.selenium.SessionNotCreatedException: Unable to create new service: EdgeDriverService**
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '3638-Panduka-Punchihewa.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.6', java.version: '11.0.2'
Driver info: driver.version: unknown
Command duration or timeout: 237 milliseconds
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$errorHandler$0(JsonWireProtocolResponse.java:54)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at org.example.WebTest.edgeTest(WebTest.java:48)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)
Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create new service: EdgeDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '3638-Panduka-Punchihewa.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.6', java.version: '11.0.2'
Driver info: driver.version: unknown
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: '3638-Panduka-Punchihewa.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.6', java.version: '11.0.2'
Driver info: driver.version: unknown
at org.openqa.selenium.grid.session.remote.ServicedSession$Factory.lambda$get$0(ServicedSession.java:135)
at org.openqa.selenium.grid.session.remote.ServicedSession$Factory.apply(ServicedSession.java:152)
at org.openqa.selenium.remote.server.ActiveSessionFactory.lambda$apply$12(ActiveSessionFactory.java:180)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:442)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
at org.openqa.selenium.remote.server.ActiveSessionFactory.apply(ActiveSessionFactory.java:183)
at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$null$2(NewSessionPipeline.java:66)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.util.Collections$2.tryAdvance(Collections.java:4745)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
at org.openqa.selenium.remote.server.NewSessionPipeline.lambda$createNewSession$3(NewSessionPipeline.java:69)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.util.stream.DistinctOps$1$2.accept(DistinctOps.java:175)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.util.stream.Streams$StreamBuilderImpl.tryAdvance(Streams.java:397)
at java.util.stream.Streams$ConcatSpliterator.tryAdvance(Streams.java:720)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
at org.openqa.selenium.remote.server.NewSessionPipeline.createNewSession(NewSessionPipeline.java:72)
at org.openqa.selenium.remote.server.commandhandler.BeginSession.execute(BeginSession.java:65)
at org.openqa.selenium.remote.server.WebDriverServlet.lambda$handle$0(WebDriverServlet.java:235)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:834)
The test should open up in the Edge browser navigating to the expected url
OS: macOS Catalina
Browser: Microsoft Edge (Chromium)
Browser version: 85.0.564.51
Browser Driver version: Microsoft Edge Driver 85.0.564.51
Selenium Grid version: 3.141.59
@panduka777 I used the following nodeConfig:
{
"capabilities":
[
{
"browserName": "MicrosoftEdge",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
}
],
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 20,
"port": -1,
"register": true,
"registerCycle": 5000,
"hub": "http://localhost:4444",
"nodeStatusCheckTimeout": 5000,
"nodePolling": 5000,
"unregisterIfStillDownAfter": 60000,
"downPollingLimit": 5,
"debug": false,
"servlets" : [],
"withoutServlets": [],
"custom": {}
}
My msedgedriver path location is: /usr/local/bin/msedgedriver
So please use this command to start the node:
java -jar -Dwebdriver.edge.driver=/usr/local/bin/msedgedriver selenium-server-standalone-3.141.59.jar -role node -nodeConfig nodeConfig.json
Here are the logs after I started the node like that and ran the script:
Hub:
java -jar selenium-server-standalone-3.141.59.jar -role hub SIGINT(2) ↵ 16:27:38
16:27:58.311 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
16:27:58.381 INFO [GridLauncherV3.lambda$buildLaunchers$5] - Launching Selenium Grid hub on port 4444
2020-09-20 16:27:58.773:INFO::main: Logging initialized @675ms to org.seleniumhq.jetty9.util.log.StdErrLog
16:27:58.915 INFO [Hub.start] - Selenium Grid hub is up and running
16:27:58.916 INFO [Hub.start] - Nodes should register to http://192.168.80.1:4444/grid/register/
16:27:58.917 INFO [Hub.start] - Clients should connect to http://192.168.80.1:4444/wd/hub
16:28:05.490 INFO [DefaultGridRegistry.add] - Registered a node http://192.168.80.1:44457
16:28:16.927 INFO [RequestHandler.process] - Got a request to create a new session: Capabilities {browserName: MicrosoftEdge}
16:28:16.930 INFO [TestSlot.getNewSession] - Trying to create a new session on test slot {server:CONFIG_UUID=009a5293-4183-4414-8d35-962aff94e2c2, seleniumProtocol=WebDriver, browserName=MicrosoftEdge, maxInstances=5, platformName=MAC, platform=MAC}
Node:
java -jar -Dwebdriver.edge.driver=/usr/local/bin/msedgedriver selenium-server-standalone-3.141.59.jar -role node -nodeConfig nodeConfig.json
16:28:04.835 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
16:28:04.916 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Launching a Selenium Grid node on port 44457
2020-09-20 16:28:04.980:INFO::main: Logging initialized @362ms to org.seleniumhq.jetty9.util.log.StdErrLog
16:28:05.151 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
16:28:05.213 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 44457
16:28:05.214 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Selenium Grid node is up and ready to register to the hub
16:28:05.240 INFO [SelfRegisteringRemote$1.run] - Starting auto registration thread. Will try to register every 5000 ms.
16:28:05.462 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://localhost:4444/grid/register
16:28:05.490 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and ready to use
16:28:16.978 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "MicrosoftEdge"
}
16:28:16.979 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.edge.EdgeDriverService)
Starting MSEdgeDriver 85.0.564.60 (7ee61562c888d6956fb738f7dafc1cbd0fafb3e9) on port 18519
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping MSEdgeDriver safe.
MSEdgeDriver was started successfully.
OneAuth Version 1.1.0 (com.microsoft.Edge)
16:28:18.677 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
16:28:18.697 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session bc26fb267ca0171a3061c233e7cc5e5b (org.openqa.selenium.edge.EdgeDriverService)
16:28:29.881 INFO [ActiveSessions$1.onStop] - Removing session bc26fb267ca0171a3061c233e7cc5e5b (org.openqa.selenium.edge.EdgeDriverService)
@diemol Thanks very much and your approach did work!
However, if I update my nodeConfig.json adding the msedgedriver path location as below;
{
"browserName": "MicrosoftEdge",
"maxInstances": 5,
"seleniumProtocol": "WebDriver",
"webdriver.edge.driver": "/usr/local/bin/msedgedriver"
}
And, start the node with the below command;
java -jar selenium-server-standalone-3.141.59.jar -role node -nodeConfig nodeConfig.json
The test code again fails with the exception "Unable to create new service: EdgeDriverService"
Does this mean, with selenuim server 3.141.59 for Microsoft Edge (Chromium) browser, passing driver path location in a .JSON file is not supported? I'd like to understand where the limitation is.
Yes, it is not supported, that is why the system property is needed.
Got it, thanks! Is this stated in any official documentation that I have missed? if so, pls do pass a reference. Thanks again.
I am not sure, Grid 3 was not completely documented and we are now focusing on Grid 4, its features, and better documentation.
That's cool.
@diemol Do you have any guide or suggestion how to use MS Edge Driver(Chromium) on Grid 4 ?
Most helpful comment
I am not sure, Grid 3 was not completely documented and we are now focusing on Grid 4, its features, and better documentation.