Unable to either launch or connect to chrome on linux

2,224 views
Skip to first unread message

bryan rasmussen

unread,
Dec 28, 2011, 5:59:01 AM12/28/11
to webd...@googlegroups.com
Hi,

Having problems connecting to chrome driver. I am at this point after
having spent several hours of problems trying to get it to even find
the chromedriver. I had this working a few weeks ago - was finding
chromedriver and running tests but then I had to go off and work on
other things, just went back to working on my tests and now can't get
it working again (poor documentation on my part, I can't remember how
I got it working in the first place, but really it seems to be a
completely different set of problems than what I encountered then)

The chrome driver version I am using is 17.0.963.0 which is the
latest. I am running on an ubuntu virtual box installation

I have done the following:

created a symlink from /usr/bin/google-chrome to my chromedriver
installation /home/vagrant/chromedriver

did sudo chmod +x /usr/bin/google-chrome

have the following ruby code when creating browser

driver = Selenium::WebDriver.for :chrome
browser_type = ENV['BROWSER'] || 'chrome'

$browser ||= Watir::Browser.new browser_type.to_sym

anyway none of that was working to get it to find chromedriver.

After looking at similar problems that other people had I moved
chromedriver directly into /usr/bin and for good measure did chmod on
it too.
After which it found webdriver although the message I got was

Unable to either launch or connect to Chrome. Please check that
ChromeDriver is up-to-date. Using Chrome binary at:
/usr/bin/google-chrome

The process is started and running when I run my tests:

/usr/bin/google-chrome --disable-hang-monitor
--disable-prompt-on-repost --dom-automation --full-memory-crash-report
--no-default-browser-check --no-first-run
--automation-reinitialize-on-channel-error --homepage=about:blank
--disable-web-resources --disable-preconnect --no-first-run
--no-default-browser-check --enable-logging --log-level=1
--safebrowsing-disable-auto-update --disable-default-apps
--skip-gpu-data-loading --allow-file-access-from-files
--password-store=basic --instant-field-trial=disabled
--no-default-browser-check --test-type=ui
--user-data-dir=/tmp/.com.google.Chrome.9ErZd8
--testing-channel=NamedTestingInterface:/tmp/.com.google.Chrome.5vBCJZ
--noerrdialogs --metrics-recording-only --enable-logging
--disable-tab-closeable-state-watcher --allow-file-access

Just to make sure I physically killed the process, and redid the tests
and got it back. So its not some old process hanging around.

probably there is some stupid thing I have neglected. Please point out
stupid thing to me so I can feel embarrassed (other than the thing
about not documenting how I got it to work last time, because boy will
I never make that mistake again)!


Thanks,
Bryan Rasmussen

bryan rasmussen

unread,
Dec 28, 2011, 6:16:48 AM12/28/11
to webd...@googlegroups.com
should also note that my Chrome version is 15.0.874.106

Simon Stewart

unread,
Dec 28, 2011, 6:30:00 AM12/28/11
to webd...@googlegroups.com
Hi,

The chromedriver is a little confusing to start with, mainly because of a Malkovich-like tendency to call _everything_ chromedriver. Hopefully this will help a little.

Essentially, there are three moving parts to consider. Chrome itself, the ChromeDriver API you use in your tests ("the driver") and the executable downloadable from the chromium project site called "chromedriver", but which you can think of as "the bridge". The bridge is responsible for taking the normal remote webdriver protocol from the driver and converting it to a form that Chrome can understand. 

You need both Chrome and the bridge set as executable and on your PATH when running your tests. On a normal ubuntu image, google-chrome should be on the PATH anyway, though it's always best to check. The only thing you should need to do is to add the directory containing the bridge ("chromedriver") to the PATH. Once that's done, fire up your tests and everything _should_ work.

The bridge is numbered against the version of the chromium tree it was developed against (17) in this case. The released versions will always work with the stable release of chrome that were current when the bridge was released. In this case, I'd strongly recommend updating to Chrome 16, which is the current stable release.

HTH,

Simon

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


bryan rasmussen

unread,
Dec 28, 2011, 8:34:44 AM12/28/11
to webd...@googlegroups.com
Hi,

I am still having problems - I believe I've done things as per your
suggestions correctly·

I changed from chromedriver 17 to 16 - although that says deprecated
in the downloads.

The following shows that chromedriver is an executable, and that
google-chrome in usr/bin is a symlink to it.

vagrant@vagrant-ubuntu-11:~$ file /home/vagrant/bin/chromedriver
/home/vagrant/bin/chromedriver: ELF 32-bit LSB executable, Intel
80386, version 1 (SYSV), dynamically linked (uses shared libs), for
GNU/Linux 2.6.15, stripped
vagrant@vagrant-ubuntu-11:~$ file /usr/bin/google-chrome
/usr/bin/google-chrome: symbolic link to `/home/vagrant/bin/chromedriver'

chrome is located at
/usr/lib/chromium-browser

I added it to my PATH

My path is now

/usr/share/ruby-rvm/gems/jruby-1.6.5/bin:/usr/share/ruby-rvm/gems/jruby-1.6.5@global/bin:/usr/share/ruby-rvm/rubies/jruby-1.6.5/bin:/usr/share/ruby-rvm/bin:/home/vagrant/bin:/usr/lib/chromium-browser:/usr/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/game

where /home/vagrant/bin has chromedriver (16)
/usr/bin has google-chrome
/usr/bin also has chromium-browser which is a script that uses GDB to run
/usr/lib/chromium-browser has the chromium-browser which is
chromium-browser: ELF 32-bit LSB shared object, Intel 80386, version
1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15,
stripped

which I guess is the problem? That it should be an executable instead
of a shared object?

The thing is I did have everything working as late as the 13th of this
month. Probably a library or gem has been changed in the latest code
updates that has caused it not to work, but if so and if you think it
is a problem that it is a shared object instead of an executable - is
there any way to get it to work the way it was before?


GEM list:

actionmailer (3.1.1)
actionpack (3.1.1)
activemodel (3.1.1)
activerecord (3.1.1)
activerecord-jdbc-adapter (1.2.0)
activerecord-jdbcsqlite3-adapter (1.2.0)
activerecord-oracle_enhanced-adapter (1.4.0)
activeresource (3.1.1)
activesupport (3.1.1)
acts_as_list (0.1.4)
arel (2.2.1)
bouncy-castle-java (1.5.0146.1)
builder (3.0.0)
bundler (1.0.21 ruby)
childprocess (0.2.3, 0.2.2)
cucumber (1.0.2)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.2.9)
ffi (1.0.11 java, 1.0.9 java)
gherkin (2.4.16 java)
hike (1.2.1)
i18n (0.6.0)
jdbc-sqlite3 (3.7.2)
jquery-rails (1.0.16)
jruby-launcher (1.0.9 java java)
jruby-openssl (0.7.4)
json (1.6.1 java, 1.5.3 java)
json_pure (1.6.3, 1.5.3)
liquid (2.3.0)
mail (2.3.0)
mime-types (1.17.2)
multi_json (1.0.3)
polyglot (0.3.3)
rack (1.3.5)
rack-cache (1.1)
rack-mount (0.8.3)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.1.1)
railties (3.1.1)
rake (0.9.2.2, 0.9.2, 0.8.7)
rdoc (3.11)
rsolr (1.0.3)
rsolr-ext (1.0.3)
rspec (2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
rspec-mocks (2.6.0)
ruby-plsql (0.4.4)
rubyzip (0.9.5, 0.9.4)
sass (3.1.10)
sass-rails (3.1.4)
selenium-webdriver (2.5.0)
sprockets (2.0.3)
term-ansicolor (1.0.6)
therubyrhino (1.72.8)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.30)
uglifier (1.0.4)
watir-webdriver (0.3.8, 0.3.2)
will_paginate (3.0.2)

Thanks,
Bryan Rasmussen

Simon Stewart

unread,
Dec 28, 2011, 10:27:03 AM12/28/11
to webd...@googlegroups.com
google-chrome and the chromedriver are separate executables. You *must not* symlink google-chrome to chromedriver. As I said in my previous email, "google-chrome" is the browser itself. "chromedriver" is the executable from the chromium site.

Regards,

Simon

Simon Stewart

unread,
Dec 28, 2011, 10:28:22 AM12/28/11
to webd...@googlegroups.com
And you want google-chrome version 16 (stable) and the latest chromedriver (17).

Yes, I know that this is confusing. If we can get the size of the chromedriver down to something more reasonable, we'll try and package it in the main jars. Sadly, right now it's fairly large, which makes this a fairly unfriendly thing to do to our users.

Simon

bryan rasmussen

unread,
Dec 28, 2011, 11:02:26 AM12/28/11
to webd...@googlegroups.com
Ok I think I understand now.when I was reading the chromedriver info page

http://code.google.com/p/selenium/wiki/ChromeDriver
where it says


"The ChromeDriver controls the browser using Chrome's automation proxy
framework. Consequently, the ChromeDriver is only compatible with
Chrome version 12.0.712.0 or newer.

The server expects you to have Chrome installed in the default
location for each system:
OS Expected Location of Chrome
Linux /usr/bin/google-chrome1"

the expected location of chrome just went into my head as the expected
location of the chromedriver.

sorry for the trouble.

thanks,
Bryan Rasmussen

On Wed, Dec 28, 2011 at 4:27 PM, Simon Stewart

Simon Stewart

unread,
Dec 29, 2011, 4:41:23 AM12/29/11
to webd...@googlegroups.com
Glad to help. That page really needs some work by the sounds of things.

Simon
Reply all
Reply to author
Forward
0 new messages