Selenium 3 Grid in Java: SessionNotCreatedException for Chrome

337 views
Skip to first unread message

Erando89

unread,
Dec 5, 2016, 10:07:54 PM12/5/16
to Selenium Users
Hi there!
Using Selenium 3 I am not able to run tests in my grid using Chrome. Here's my setup:

@Before
public void setUp() {

   
this.baseUrl = Config.getProperty("WEBAPP.PATH");

   
System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\chromedriver.exe");

   
DesiredCapabilities chromeCaps = DesiredCapabilities.chrome();
    chromeCaps
.setVersion("54.0.2840.99");
   
this.driver = new RemoteWebDriver(new URL(SELENIUM_GRID_URL), chromeCaps);

}

Here's my node's config:

{
 
"capabilities":
 
[
   
{
     
"browserName": "firefox",
     
"maxInstances": 5,
     
"seleniumProtocol": "WebDriver"
   
},
   
{
     
"browserName": "chrome",
     
"maxInstances": 5,
     
"seleniumProtocol": "WebDriver",
     
"webdriver.chrome.driver": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
     
"browser-version": "54.0.2840.99"
   
},
   
{
     
"platform": "WINDOWS",
     
"browserName": "internet explorer",
     
"maxInstances": 1,
     
"seleniumProtocol": "WebDriver"
   
}
 
],
 
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
 
"maxSession": 5,
 
"port": 5555,
 
"register": true,
 
"registerCycle": 5000,
 
"hub": "http://localhost:4444"
}

But the exception when calling the RemoteWebDriver constructor is always:


g.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{browserName=chrome, version=54.0.2840.99, platform=WIN10}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'DESKTOP-G3JOA4U', ip: '192.168.212.50', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_112'
Driver info: driver.version: RemoteWebDriver
    at org
.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91)
    at org
.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
    at org
.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
    at org
.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
    at org
.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
    at org
.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:155)
    at de
.myproject.SeleniumTest.setUp(SeleniumTest.java:71)

I also tried altering the node config like this:


"webdriver.chrome.driver": "C:\\Program Files (x86)\\chromedriver.exe"


Always the same error...

Versions:

selenium-server-standalone-3.0.1.jar
selenium-java-3.0.1.jar
selenium-chrome-driver-3.0.1.jar
selenium-remote-driver-3.0.1.jar
selenium-api-3.0.1.jar
jdk1.8.0_112

Grid running on Windows Server 2012 R2.


Thanks for helping me out!


⇜Krishnan Mahadevan⇝

unread,
Dec 5, 2016, 10:43:27 PM12/5/16
to Selenium Users
Please try the following.
  • Open a command prompt and type echo %PATH%.
  • Make a note of the path contents and have your chromedriver binary (chromedriver.exe and not chrome.exe) in one of the directories that are part of your PATH variable.
  • Now drop the attribute "webdriver.chrome.driver": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe", from your node config and try again.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/737d722c-b894-4198-9bd4-311204241841%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages