Unable to build chrome driver

752 views
Skip to first unread message

bp

unread,
May 9, 2011, 11:49:40 AM5/9/11
to webdriver
I am trying to build webdriver locally.

I can build firefox and htmunit just fine, on a linux debian

When I run ./go test_chrome, I see the following error in the logs

The path to the chromedriver executable must be set by the
webdriver.chrome.driver system property
java.lang.IllegalStateException: The path to the chromedriver
executable must be set by the webdriver.chrome.driver system property
at com.google.common.base.Preconditions.checkState(Preconditions.java:
172)
at
org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:
90)
at
org.openqa.selenium.chrome.ChromeDriverTestSuite.suite(ChromeDriverTestSuite.java:
37)


I tried

setenv PATH /opt/google/chrome:$PATH : Did not work

then

setenv webdriver.chrome.driver /usr/bin/google-chrome : did not work


How do I specify a -D option which looks like the one that is being
used, based on this code:
http://code.google.com/p/selenium/source/browse/trunk/java/client/src/org/openqa/selenium/chrome/ChromeDriverService.java

bp

unread,
May 9, 2011, 2:40:02 PM5/9/11
to webdriver
Follow up on this

I did manage to get past this problem by temporarily making
ChromeDriverService read the environment variable for the chrome
binary, but now it gives me this

Timed out waiting for http://localhost:12840 to be available after
20005 ms
java.lang.RuntimeException: Timed out waiting for http://localhost:12840
to be available after 20005 ms
at
org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:
76)
at
org.openqa.selenium.chrome.ChromeDriverService.start(ChromeDriverService.java:
153)
at org.openqa.selenium.chrome.ChromeDriverTestSuite
$ServiceStarter.setUp(ChromeDriverTestSuite.java:78)
at junit.extensions.TestSetup$1.protect(TestSetup.java:22)
at junit.extensions.TestSetup.run(TestSetup.java:27)
> used, based on this code:http://code.google.com/p/selenium/source/browse/trunk/java/client/src...

Jim Evans

unread,
May 9, 2011, 2:56:13 PM5/9/11
to webdriver
You shouldn't be looking for the Chrome binary; you should be looking
for the new ChromeDriver.exe executable file, which can be downloaded
from http://code.google.com/p/selenium/downloads/list. This executable
must be on you path, or pointed to by the webdriver.chrome.driver
system property. Note also that this requires Chrome 12.0.712.0 to
work.

All of this is documented on the wiki page for the Chrome driver at
http://code.google.com/p/selenium/wiki/ChromeDriver.

Regards,
--Jim

On May 9, 2:40 pm, bp <bino...@gmail.com> wrote:
> Follow up on this
>
> I did manage to get past this problem by temporarily making
> ChromeDriverService read the environment variable for the chrome
> binary, but now it gives me this
>
> Timed out waiting forhttp://localhost:12840to be available after
> 20005 ms
> java.lang.RuntimeException: Timed out waiting forhttp://localhost:12840
> to be available after 20005 ms
>         at
> org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:
> 76)
>         at
> org.openqa.selenium.chrome.ChromeDriverService.start(ChromeDriverService.ja­va:
> 153)
>         at org.openqa.selenium.chrome.ChromeDriverTestSuite
> $ServiceStarter.setUp(ChromeDriverTestSuite.java:78)
>         at junit.extensions.TestSetup$1.protect(TestSetup.java:22)
>         at junit.extensions.TestSetup.run(TestSetup.java:27)
>
> On May 9, 11:49 am, bp <bino...@gmail.com> wrote:
>
>
>
> > I am trying to build webdriver locally.
>
> > I can build firefox and htmunit just fine, on a linux debian
>
> > When I run ./go test_chrome, I see the following error in the logs
>
> > The path to the chromedriver executable must be set by the
> > webdriver.chrome.driver system property
> > java.lang.IllegalStateException: The path to the chromedriver
> > executable must be set by the webdriver.chrome.driver system property
> >         at com.google.common.base.Preconditions.checkState(Preconditions.java:
> > 172)
> >         at
> > org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeD­riverService.java:
> > 90)
> >         at
> > org.openqa.selenium.chrome.ChromeDriverTestSuite.suite(ChromeDriverTestSuit­e.java:
> > 37)
>
> > I tried
>
> > setenv PATH /opt/google/chrome:$PATH : Did not work
>
> > then
>
> > setenv webdriver.chrome.driver /usr/bin/google-chrome : did not work
>
> > How do I specify a -D option which looks like the one that is being
> > used, based on this code:http://code.google.com/p/selenium/source/browse/trunk/java/client/src...- Hide quoted text -
>
> - Show quoted text -

bp

unread,
May 9, 2011, 3:04:55 PM5/9/11
to webdriver
Oh indeed!

Does this mean I can't use the new ChromeDriver with Chrome <=11? v 11
is what we have right now, from the stable release.

If we use the new version, should we be using WebdriverBackedSelenium
for Chrome, where we have been using the older ChromeDriver?

If that is the case, we should probably continue using b3 until chrome
12 has become 'commonplace' for our users.

Thanks

On May 9, 2:56 pm, Jim Evans <james.h.evans...@gmail.com> wrote:
> You shouldn't be looking for the Chrome binary; you should be looking
> for the new ChromeDriver.exe executable file, which can be downloaded
> fromhttp://code.google.com/p/selenium/downloads/list. This executable
> must be on you path, or pointed to by the webdriver.chrome.driver
> system property. Note also that this requires Chrome 12.0.712.0 to
> work.
>
> All of this is documented on the wiki page for the Chrome driver athttp://code.google.com/p/selenium/wiki/ChromeDriver.
>
> Regards,
> --Jim
>
> On May 9, 2:40 pm, bp <bino...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Follow up on this
>
> > I did manage to get past this problem by temporarily making
> > ChromeDriverService read the environment variable for the chrome
> > binary, but now it gives me this
>
> > Timed out waiting forhttp://localhost:12840tobe available after
> > > used, based on this code:http://code.google.com/p/selenium/source/browse/trunk/java/client/src...Hide quoted text -

Jim Evans

unread,
May 10, 2011, 3:11:49 PM5/10/11
to webdriver
My understanding is that the new Chrome driver hooks into internals in
the browser itself which are not exposed in versions < 12. On the plus
side, 12.0.742.30 just went live in the beta channel (previously it
was only available in the dev channel). If current release cycles
hold, you'll see Chrome 12 go to the stable channel in a matter of
weeks.

--Jim

On May 9, 3:04 pm, bp <bino...@gmail.com> wrote:
> Oh indeed!
>
> Does this mean I can't use the new ChromeDriver with Chrome <=11? v 11
> is what we have right now, from the stable release.
>
> If we use the new version, should we be using WebdriverBackedSelenium
> for Chrome, where we have been using the older ChromeDriver?
>
> If that is the case, we should probably continue using b3 until chrome
> 12 has become 'commonplace' for our users.
>
> Thanks
>
> On May 9, 2:56 pm, Jim Evans <james.h.evans...@gmail.com> wrote:
>
>
>
> > You shouldn't be looking for the Chrome binary; you should be looking
> > for the new ChromeDriver.exe executable file, which can be downloaded
> > fromhttp://code.google.com/p/selenium/downloads/list. This executable
> > must be on you path, or pointed to by the webdriver.chrome.driver
> > system property. Note also that this requires Chrome 12.0.712.0 to
> > work.
>
> > All of this is documented on the wiki page for the Chrome driver athttp://code.google.com/p/selenium/wiki/ChromeDriver.
>
> > Regards,
> > --Jim
>
> > On May 9, 2:40 pm, bp <bino...@gmail.com> wrote:
>
> > > Follow up on this
>
> > > I did manage to get past this problem by temporarily making
> > > ChromeDriverService read the environment variable for the chrome
> > > binary, but now it gives me this
>
> > > Timed out waiting forhttp://localhost:12840tobeavailable after
> > > > used, based on this code:http://code.google.com/p/selenium/source/browse/trunk/java/client/src...quoted text -
>
> > > - Show quoted text -- Hide quoted text -

bp

unread,
May 11, 2011, 12:57:42 PM5/11/11
to webdriver
So, in future versions of ChromeDriver, we have to do something along
the lines of:

set webdriver.chrome.driver = path/to/chrome/driver/for/this/platform

then start ChromeDriver?

I am just curious why there are platform specific executable for
chrome driver now as opposed to embedded server classes.

This is going to be a pain because we now have to make sure these
executables are available for every dependent project that uses our
tools based on Selenium as well. Or, did I miss something crucial?

also, does it not defeat the purpose of using the selenium2 api one of
whose appeals was to have automatic server process control?

Thanks
> > > > > used, based on this code:http://code.google.com/p/selenium/source/browse/trunk/java/client/src...text -

Jim Evans

unread,
May 11, 2011, 1:47:26 PM5/11/11
to webdriver
I'll try to answer your questions as best I can, but be aware that I
don't really use the Java language bindings. If the executable
(ChromeDriver.exe) is on your path, then you need do nothing more
than:

WebDriver driver = new ChromeDriver();

If you want to specify the location of the executable, only then do
you need to specify the system property. Other language bindings may
handle things a little differently. For example, the default
constructor for the ChromeDriver class in the .NET bindings will first
look for the executable in the same directory as the
WebDriver.Chrome.dll assembly.

The ChromeDriver executable is written in C++. It's not maintained by
the Selenium team; it's built as part of the Chromium project (the
open-source project on which the Google Chrome browser is based). As a
native C++ application, it must be recompiled for each platform you
need to run it on. The big win here is that it's the browser
manufacturer, not the Selenium team, maintaining the code needed to
drive that particular browser; it is they who are responsible for
keeping up with changes to the browser, not the cat-and-mouse game we
see with some other browsers.

I'm not sure what you mean by "automatic server process control". The
WebDriver ChromeDriver class should start and stop the ChromeDriver
executable automatically. It's not something you *have* to manually
start (though, of course, you can, and can manually control the
lifetime of the executable process, if you want to). You can find more
about the ChromeDriver in the project wiki[1].

Regards,
--Jim

[1] http://code.google.com/p/selenium/wiki/ChromeDriver
> > > > > > used, based on this code:http://code.google.com/p/selenium/source/browse/trunk/java/client/src...-

Lisak

unread,
May 24, 2011, 7:14:56 PM5/24/11
to webdriver
I have this issue too, using chrome 12.0.742.60 and
chromedriver_linux64_12.0.727.0

May 25, 2011 12:57:28 AM org.openqa.selenium.net.UrlChecker$1 call
INFO: Polling http://localhost:19712
May 25, 2011 12:57:29 AM org.openqa.selenium.net.UrlChecker$1 call
INFO: Polling http://localhost:19712
May 25, 2011 12:57:29 AM org.openqa.selenium.net.UrlChecker$1 call
INFO: Polling http://localhost:19712
Tests run: 2, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 20.817
sec <<< FAILURE!
prepareComponents(cz.instance.transl.tests.selenium.SubmitUploadFormTest)
Time elapsed: 0 sec <<< FAILURE!
java.lang.RuntimeException: Timed out waiting for http://localhost:19712
to be available after 20010 ms
at
org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:
76)
at
org.openqa.selenium.chrome.ChromeDriverService.start(ChromeDriverService.java:
149)
at
org.openqa.selenium.chrome.ChromeCommandExecutor.execute(ChromeCommandExecutor.java:
48)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
389)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:
103)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
86)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:
93)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:
83)
at
cz.instance.transl.tests.selenium.SubmitUploadFormTest.prepareComponents(SubmitUploadFormTest.java:
21)

Lisak

unread,
May 25, 2011, 4:21:05 AM5/25/11
to webdriver
The problem was, that chromedriver binary hadn't a few libraries
available because there is no wrapper as google-chrome is for chrome
binary....

So instead of symlinking I created a google-chromedriver wrapper and I
run the driver first and then create RemoteWebDriver with java
bindings and connect to it.

I did that because I'm using Slackware and it kinda didn't allow more
than 1 level of symlinks, for instance this would throw "error 40"
which means ELOOP, "too many symbolic links encountered"

/usr/lib64/libnss3.so.1d -> /opt/google/chrome/libnss3.so.1d -> /usr/
lib64/seamonkey/libnss3.so
Reply all
Reply to author
Forward
0 new messages