Discussion:
[selenium-users] Selenium Grid Exception - Exception in thread "main" org.openqa.selenium.SessionNotCreatedException:
Tany S
2018-11-27 12:24:09 UTC
Permalink
Hi All,

i am unable to launch chrome browser using grid when i set chrome driver
property in code.

Code -

public class ChromeGridTest {
public static void main(String[] args) throws MalformedURLException {
System.setProperty("webdriver.gecko.driver",
"C:\\chromedriver_win32\\chromedriver.exe");
DesiredCapabilities cap = new DesiredCapabilities();
cap.setBrowserName("chrome");
cap.setPlatform(Platform.WINDOWS);
ChromeOptions options = new ChromeOptions();
options.merge(cap);
String hubURL= "http://192.168.2.95:4444/wd/hub";
WebDriver driver = new RemoteWebDriver(new URL(hubURL), options);
driver.get("http://www.gmail.com");
System.out.println(driver.getTitle());
driver.quit();
}
}

Exception -

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException:
Unable to create new service: ChromeDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time:
'2018-11-14T08:25:53'
System info: host: 'SAURABH-PC', ip: '192.168.3.227', os.name: 'Windows 7',
os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_181'
Driver info: driver.version: unknown
Command duration or timeout: 256 milliseconds
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: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.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at
java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at
java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
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 gridTest.ChromeGridTest.main(ChromeGridTest.java:32)
Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create
new service: ChromeDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time:
'2018-11-14T08:25:53'
System info: host: 'SAURABH-PC', ip: '192.168.3.227', os.name: 'Windows 7',
os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_181'
Driver info: driver.version: unknown
Build info: version: '3.141.59', revision: 'e82be7d358', time:
'2018-11-14T08:17:03'
System info: host: 'PC', ip: '192.168.2.95', os.name: 'Windows 7', os.arch:
'amd64', os.version: '6.1', java.version: '1.8.0_151'
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(Unknown Source)
at java.util.stream.ReferencePipeline$11$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
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(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.Collections$2.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
at
org.openqa.selenium.remote.server.NewSessionPipeline.lambda$createNewSession$3(NewSessionPipeline.java:69)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.stream.DistinctOps$1$2.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.stream.Streams$StreamBuilderImpl.tryAdvance(Unknown Source)
at java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
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(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

But when i register a node by setting chrome driver it works fine.
Below is the command which works -
java -Dwebdriver.chrome.driver="C:\chromedriver_win32\chromedriver.exe"
-jar selenium-server-standalone-3.141.59.jar -role node -hub
http://192.168.2.95:4444/grid/register

now , why it's not working in alternate way?
can anyone help me on this, where i am wrong.

Thanks,
Tanmoy
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/aabd6655-4723-4735-8450-6ace3898d361%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
a***@gmail.com
2018-11-27 17:18:17 UTC
Permalink
You are trying to set "webdriver.gecko.driver" with Chrome driver?
Post by Tany S
Hi All,
i am unable to launch chrome browser using grid when i set chrome driver
property in code.
Code -
public class ChromeGridTest {
public static void main(String[] args) throws MalformedURLException {
System.setProperty("webdriver.gecko.driver",
"C:\\chromedriver_win32\\chromedriver.exe");
DesiredCapabilities cap = new DesiredCapabilities();
cap.setBrowserName("chrome");
cap.setPlatform(Platform.WINDOWS);
ChromeOptions options = new ChromeOptions();
options.merge(cap);
String hubURL= "http://192.168.2.95:4444/wd/hub";
WebDriver driver = new RemoteWebDriver(new URL(hubURL), options);
driver.get("http://www.gmail.com");
System.out.println(driver.getTitle());
driver.quit();
}
}
Exception -
Unable to create new service: ChromeDriverService
'2018-11-14T08:25:53'
System info: host: 'SAURABH-PC', ip: '192.168.3.227', os.name: 'Windows
7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_181'
Driver info: driver.version: unknown
Command duration or timeout: 256 milliseconds
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: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.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at
java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at
java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at
java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
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 gridTest.ChromeGridTest.main(ChromeGridTest.java:32)
Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to
create new service: ChromeDriverService
'2018-11-14T08:25:53'
System info: host: 'SAURABH-PC', ip: '192.168.3.227', os.name: 'Windows
7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_181'
Driver info: driver.version: unknown
'2018-11-14T08:17:03'
System info: host: 'PC', ip: '192.168.2.95', os.name: 'Windows 7',
os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_151'
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(Unknown Source)
at java.util.stream.ReferencePipeline$11$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
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(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.Collections$2.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
at
org.openqa.selenium.remote.server.NewSessionPipeline.lambda$createNewSession$3(NewSessionPipeline.java:69)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.stream.DistinctOps$1$2.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.stream.Streams$StreamBuilderImpl.tryAdvance(Unknown Source)
at java.util.stream.Streams$ConcatSpliterator.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
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(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
But when i register a node by setting chrome driver it works fine.
Below is the command which works -
java -Dwebdriver.chrome.driver="C:\chromedriver_win32\chromedriver.exe"
-jar selenium-server-standalone-3.141.59.jar -role node -hub
http://192.168.2.95:4444/grid/register
now , why it's not working in alternate way?
can anyone help me on this, where i am wrong.
Thanks,
Tanmoy
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2d4c7fcb-03c5-4d25-bc9e-f03986fce211%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...