I'd like to run automated tests using selenium2's chrome webdriver on a linux server.
I've already set up firefox to run on the server by using Xvfb (See http://www.semicomplete.com/blog/geekery/xvfb-firefox.html) and would like to do something similar with chrome. Is this possible?
I was facing the same challenge of setting a linux box with selenium + chromedriver, and here's my notes:
Pre-reqs:
Install JRE to run the selenium jar
Install the selenium server
grab the jar file from https://code.google.com/p/selenium/downloads/list)
Install xvfb (you've seem to have already achieved this part)
Install google-chrome for your linux distribution
Download the chrome driver You can grab it from here: https://sites.google.com/a/chromium.org/chromedriver/downloads
Install other selenium dependencies that you might need (but the above is the minimum to get chromedriver to work)
To run:
Reference: http://www.yann.com/en/use-xvfb-selenium-and-chrome-to-drive-a-web-browser-in-php-23/08/2012.html
Cheers!
According to SetEnvironmentProperty to ChromeDriver programatically you can do the following:
Here is the documentation for
withEnvironment
I haven't been able to find a way to do this programmatically for the ChromeDriver like you can with the FirefoxBinary.
I've submitted a improvement request which has a patch attached to allow this. You can see it here: http://code.google.com/p/selenium/issues/detail?id=2673
Edit: You can see below response from Stephen on how to use this now the change has been merged.: https://stackoverflow.com/a/16619608/998442