Issues with Chrome browser while starting it with the grid (webdriver)

2,446 views
Skip to first unread message

jyo rani

unread,
Jun 22, 2012, 7:00:42 PM6/22/12
to webdriver
Not sure what is going here.....

This is how i defined my chrome driver

public static WebDriver getChromeBrowser() throws
MalformedURLException
{ DesiredCapabilities capability=null;
System.setProperty("webdriver.chrome.driver", "src//main//resources//
chromedriver//chromedriver.exe");
capability= DesiredCapabilities.chrome();
capability.setBrowserName("chrome");
capability.setPlatform(org.openqa.selenium.Platform.WINDOWS);
return new RemoteWebDriver(new URL("http://selgrid:4444/wd/hub"),
capability);
}

cmd using to launch the node

java -jar selenium-server-standalone-2.20.0.jar -role node -hub
http://selgridin001:4444/grid/register -browser
"browserName=chrome,platform=WINDOWS"

Error when i start hub

16:58:07.684 INFO - Done: /status
16:58:12.512 INFO - Executing: [new session: {platform=WINDOWS,
browserName=chro
me, version=}] at URL: /session)
16:58:12.575 WARN - Exception thrown
java.util.concurrent.ExecutionException:
org.openqa.selenium.WebDriverException:
java.lang.reflect.InvocationTargetException
Build info: version: '2.20.0', revision: '16008', time: '2012-02-27
19:03:04'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.vers
ion: '1.6.0'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask
$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at
org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSessi
on.java:139)
at
org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSessio
n.java:108)
at
org.openqa.selenium.remote.server.DefaultSession.createSession(Defaul
tSession.java:86)
at
org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(De
faultDriverSessions.java:87)
at
org.openqa.selenium.remote.server.handler.NewSession.handle(NewSessio
n.java:62)
at
org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConf
ig.java:196)
at
org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverS
ervlet.java:580)
at
org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.
java:531)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
727)
at
org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet
.java:503)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
820)
at
org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.jav
a:428)
at
org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler
.java:677)
at
org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.j
ava:568)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:
1530)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:
1482)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:
909)
at
org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)

at
org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:9
86)
at
org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at
org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.
java:243)
at
org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.openqa.jetty.util.ThreadPool
$PoolThread.run(ThreadPool.java:534)
Caused by: org.openqa.selenium.WebDriverException:
java.lang.reflect.InvocationT
argetException
Build info: version: '2.20.0', revision: '16008', time: '2012-02-27
19:03:04'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.vers
ion: '1.6.0'
Driver info: driver.version: unknown
at
org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructo
r(DefaultDriverFactory.java:73)
at
org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(De
faultDriverFactory.java:57)
at org.openqa.selenium.remote.server.DefaultSession
$BrowserCreator.call(
DefaultSession.java:177)
at org.openqa.selenium.remote.server.DefaultSession
$BrowserCreator.call(
DefaultSession.java:1)
at java.util.concurrent.FutureTask
$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExec
utor.java:885)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor
.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:
513)
at
org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructo
r(DefaultDriverFactory.java:63)
... 8 more
Caused by: java.lang.IllegalStateException: The path to the
chromedriver executa
ble must be set by the webdriver.chrome.driver system property; for
more informa
tion, see http://code.google.com/p/selenium/wiki/ChromeDriver. The
latest versio
n can be downloaded from http://code.google.com/p/chromedriver/downloads/list
at
com.google.common.base.Preconditions.checkState(Preconditions.java:17
2)
at
org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(C
hromeDriverService.java:103)
at
org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:110)

... 13 more
16:58:12.637 WARN - Exception: The path to the chromedriver executable
must be s
et by the webdriver.chrome.driver system property; for more
information, see htt
p://code.google.com/p/selenium/wiki/ChromeDriver. The latest version
can be down
loaded from http://code.google.com/p/chromedriver/downloads/list
16:58:12.700 INFO - Executing:
org.openqa.selenium.remote.server.handler.Status@
acb158 at URL: /status)
16:58:12.715 INFO - Done: /status
16:58:17.731 INFO - Executing:
org.openqa.selenium.remote.server.handler.Status@
b33d0a at URL: /status)
16:58:17.731 INFO - Done: /status
16:58:22.762 INFO - Executing:
org.openqa.selenium.remote.server.handler.Status@
89cc5e at URL: /status)
16:58:22.762 INFO - Done: /status
29250 [SeleniumServerShutDownHook] INFO
org.openqa.selenium.server.SeleniumServe
r - Shutting down...
29250 [Acceptor
ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=5555]] INFO o
rg.openqa.jetty.util.ThreadedServer - Stopping Acceptor
ServerSocket[addr=0.0.0.
0/0.0.0.0,port=0,localport=5555]
29359 [SeleniumServerShutDownHook] INFO
org.openqa.jetty.http.SocketListener - S
topped SocketListener on 0.0.0.0:5555
29422 [SeleniumServerShutDownHook] INFO
org.openqa.jetty.util.Container - Stoppe
d HttpContext[/selenium-server/driver,/selenium-server/driver]
29469 [SeleniumServerShutDownHook] INFO
org.openqa.jetty.util.Container - Stoppe
d HttpContext[/selenium-server,/selenium-server]
29516 [SeleniumServerShutDownHook] INFO
org.openqa.jetty.util.Container - Stoppe
d HttpContext[/,/]
29516 [SeleniumServerShutDownHook] INFO
org.openqa.jetty.util.Container - Stoppe
d org.openqa.jetty.jetty.servlet.ServletHandler@76cbf7
29562 [SeleniumServerShutDownHook] INFO
org.openqa.jetty.util.Container - Stoppe
d HttpContext[/wd,/wd]
29562 [SeleniumServerShutDownHook] INFO
org.openqa.jetty.util.Container - Stoppe
d org.openqa.jetty.jetty.Server@1f1fba0

Krishnan Mahadevan

unread,
Jun 22, 2012, 10:09:12 PM6/22/12
to webd...@googlegroups.com


On Saturday, June 23, 2012, jyo rani wrote:
Not sure what is going here.....

This is how i defined my chrome driver

       public static WebDriver getChromeBrowser() throws
MalformedURLException
       {       DesiredCapabilities capability=null;
               System.setProperty("webdriver.chrome.driver", "src//main//resources//
chromedriver//chromedriver.exe");
               capability= DesiredCapabilities.chrome();
               capability.setBrowserName("chrome");
               capability.setPlatform(org.openqa.selenium.Platform.WINDOWS);
               return new RemoteWebDriver(new URL("http://selgrid:4444/wd/hub"),
capability);
       }

cmd using to launch the node

java -jar selenium-server-standalone-2.20.0.jar -role node -hub
http://selgridin001:4444/grid/register -browser
"browserName=chrome,platform=WINDOWS"

You would need to tell the Grid where your chromedriver is available. You can take a look at my post to know more :  http://rationaleemotions.wordpress.com/2012/01/23/setting-up-grid2-and-working-with-it/

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.



--
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/

jyo rani

unread,
Jun 23, 2012, 1:15:30 AM6/23/12
to webd...@googlegroups.com
Thanks for the pointers,Here is what i tried, still no luck

I added the "System.setProperty("webdriver.chrome.driver", "C://chromedriver//chromedriver.exe");" where chrome driver resides on the slave box Intially it was System.setProperty("webdriver.chrome.driver", "src//main//resources//chromedriver//chromedriver.exe"); - not sure if this is required or not as chrome driver path is given while registering the node.

Now I don't see any errors when node is started,but the test fails very beginning with null pointer exception. Same test runs fine with IE and firefox. Here is the cmd i am using to run with IE browser
----------------------
java -jar selenium-server-standalone-2.20.0.jar -role node -hub http://selgridin001:4444/grid/register -port 5555 -browser 

"browserName=internet explorer,version=8,platform=WINDOWS"
---------------------------------------

I can't understand where i am going wrong


public static WebDriver getChromeBrowser() throws MalformedURLException
{ DesiredCapabilities capability=null;
System.setProperty("webdriver.chrome.driver", "C://chromedriver//chromedriver.exe");
capability= DesiredCapabilities.chrome();
capability.setBrowserName("chrome");
capability.setVersion("19");
capability.setPlatform(org.openqa.selenium.Platform.WINDOWS);
return new RemoteWebDriver(new URL("http://selgridin001:4444/wd/hub"), capability);
}

cmd using to run with port 

java -jar selenium-server-standalone-2.20.0.jar -role node -Dwebdriver.chrome.driver="C:\Chromedriver\chromedriver.exe" -hub 

http://selgridin001:4444/grid/register -port 5556 -browser"browserName=chrome,version =19,platform=WINDOWS"

cmd using to run without port 

java -jar selenium-server-standalone-2.20.0.jar -role node -Dwebdriver.chrome.driver="C:\Chromedriver\chromedriver.exe" -hub 

http://selgridin001:4444/grid/register-browser"browserName=chrome,version =19,platform=WINDOWS"

Krishnan Mahadevan

unread,
Jun 23, 2012, 1:19:11 AM6/23/12
to webd...@googlegroups.com
From your test code you "can never set properties on a remote machine".
You can do that only if you are starting the grid and node "locally" on your machine. 

 Please pass the path to where chrome driver resides as a VM arg to the node (not grid if grid and node are different machines) and retry. 
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

jyo rani

unread,
Jun 23, 2012, 11:58:14 AM6/23/12
to webd...@googlegroups.com
Okay..I removed the path of chrome driver in the code

public static WebDriver getChromeBrowser() throws MalformedURLException
{ DesiredCapabilities capability=null;
        capability= DesiredCapabilities.chrome();
capability.setBrowserName("chrome");
capability.setVersion("19");
capability.setPlatform(org.openqa.selenium.Platform.WINDOWS);
return new RemoteWebDriver(new URL("http://selgridin001:4444/wd/hub"), capability);
}


Here is the command using

C:\selenium-server>java -jar selenium-server-standalone-2.20.0.jar -role node -D
webdriver.chrome.driver="C:\Chromedriver\chromedriver.exe" -hub  http://selgridi
n001:4444/grid/register -browser"browserName=chrome,version=19,platform=WINDOWS"

Jun 23, 2012 9:50:41 AM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid node
Setting system property webdriver.chrome.driver to C:\Chromedriver\chromedriver.
exe
63 [main] INFO org.openqa.selenium.server.SeleniumServer - Java: Sun Microsystem
s Inc. 1.6.0-b105
63 [main] INFO org.openqa.selenium.server.SeleniumServer - OS: Windows XP 5.1 x8
6
78 [main] INFO org.openqa.selenium.server.SeleniumServer - v2.20.0, with Core v2
.20.0. Built from revision 16008
297 [main] INFO org.openqa.selenium.server.SeleniumServer - RemoteWebDriver inst
ances should connect to: http://127.0.0.1:5555/wd/hub
297 [main] INFO org.openqa.jetty.http.HttpServer - Version Jetty/5.1.x
297 [main] INFO org.openqa.jetty.util.Container - Started HttpContext[/selenium-
server/driver,/selenium-server/driver]
297 [main] INFO org.openqa.jetty.util.Container - Started HttpContext[/selenium-
server,/selenium-server]
297 [main] INFO org.openqa.jetty.util.Container - Started HttpContext[/,/]
313 [main] INFO org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty
.servlet.ServletHandler@76cbf7
313 [main] INFO org.openqa.jetty.util.Container - Started HttpContext[/wd,/wd]
328 [main] INFO org.openqa.jetty.http.SocketListener - Started SocketListener on
328 [main] INFO org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty
.Server@1f1fba0
09:50:42.173 INFO - using the json request : {"class":"org.openqa.grid.common.Re
gistrationRequest","capabilities":[{"seleniumProtocol":"Selenium","browserName":
"*firefox","maxInstances":5},{"seleniumProtocol":"Selenium","browserName":"*goog
lechrome","maxInstances":5},{"seleniumProtocol":"Selenium","browserName":"*iexpl
ore","maxInstances":1},{"seleniumProtocol":"WebDriver","browserName":"firefox","
maxInstances":5},{"seleniumProtocol":"WebDriver","browserName":"chrome","maxInst
ances":5},{"seleniumProtocol":"WebDriver","browserName":"internet explorer","max
Instances":1}],"configuration":{"port":5555,"host":"10.10.21.249","Dwebdriver.ch
rome.driver=C:\\Chromedriver\\chromedriver.exe":"","browserbrowserName=chrome,ve
rsion=19,platform=WINDOWS":"","hubHost":"selgridin001","registerCycle":5000,"hub
oteHost":"http://10.0.21.249:5555","register":true,"proxy":"org.openqa.grid.sel
enium.proxy.DefaultRemoteProxy","maxSession":5,"role":"node","hubPort":4444}}
09:50:42.189 INFO - starting auto register thread. Will try to register every 50
00 ms.
09:50:42.189 INFO - Registering the node to hub :http://selgridin001:4444/grid/r
egister


=======ERROR=============================================
org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : {platform=WINDOWS, browserName=chrome, version=19}
Command duration or timeout: 125 milliseconds


============================================================

Krishnan Mahadevan

unread,
Jun 23, 2012, 1:57:17 PM6/23/12
to webd...@googlegroups.com


On Saturday, June 23, 2012, jyo rani wrote:
Okay..I removed the path of chrome driver in the code

public static WebDriver getChromeBrowser() throws MalformedURLException
{ DesiredCapabilities capability=null;
        capability= DesiredCapabilities.chrome();
capability.setBrowserName("chrome");
capability.setVersion("19");
capability.setPlatform(org.openqa.selenium.Platform.WINDOWS);
return new RemoteWebDriver(new URL("http://selgridin001:4444/wd/hub"), capability);
}


Here is the command using

C:\selenium-server>java -jar selenium-server-standalone-2.20.0.jar -role node -D
webdriver.chrome.driver="C:\Chromedriver\chromedriver.exe" -hub  http://selgridi
n001:4444/grid/register -browser"browserName=chrome,version=19,platform=WINDOWS"


You forgot to include a space between browser and double quotes. It should be something like this. 

-browser browserName=firefox,version=3.6,maxInstances=5,platform=LINUX

Look at how the browser param was read by the Grid because you missed leaving a space between browser and browserName. 

jyo rani

unread,
Jun 23, 2012, 7:40:04 PM6/23/12
to webd...@googlegroups.com
Much Thanks,It is working now.

I really appreciate your help!

--
Reply all
Reply to author
Forward
0 new messages