How to set up Selenium with Chromedriver on Jenkins-hosted Grid How to set up Selenium with Chromedriver on Jenkins-hosted Grid jenkins jenkins

How to set up Selenium with Chromedriver on Jenkins-hosted Grid


You can use this as a node setup code:

java -jar selenium-server-standalone-2.19.0.jar -Dwebdriver.chrome.driver="C:\Java\chromedriver.exe" -role node -hub http://localhost:4444/grid/register -browser "browserName=internet explorer,version=8,platform=WINDOWS" -browser "browserName=chrome,version=17,platform=WINDOWS" -browser "browserName=firefox,version=9,platform=WINDOWS" -browser "browserName=opera,version=11,platform=WINDOWS"

So there is direct point to chromedriver binary and it is a chromedriver.exe not the common chrome.exe. I had similar problem and it worked for me.


Just went through the same process myself.

Using Selenium Plugin you can set up the selenium grid.
Using Chromedriver Plugin you can have chrome driver automatically installed.
Using Selenium Axis Plugin you can create matrix jobs.

First time installation issueAfter installing the Chromedriver plugin it can take a few minutes to download and be ready after it is automatically installed.It can be that the slaves try and install the chromedriver before master is fully installed and so fail to lookup the download location.Restarting the slaves will cause it to try again and install the chromedriver on the slaves.

On each slave and the master you should finally end up with a $JENKINS_HOME\tools\chromedriver\chromedrive.exe which you can refer to in the Jenkins Selenium plugin configuration for Chrome[driver] binary path as tools\chromedrive\chromedriver.exe and Jenkins will prepend the slave specific $JENKINS_HOME for you.Jenkins Selenium Config

Installed Chrome to the default location which turned out to be C:\Program Files (x86)\Google\Chrome\Application\chrome.exe same as described.

At this point I could run a test job succesfully without the error you have shown.

DesiredCapabilities capability = DesiredCapabilities.chrome();WebDriver driver = new RemoteWebDriver(new URL("http://Jenkins.ip.here:4444/wd/hub"), capability);driver.get(siteBase.toString());String page = driver.getPageSource();

So some other things to consider

  • having changed jenkins selenium config, did you restart selenium service, after config change it appears to stop them. Does the config have instances specified.
  • if it was an install location issue, you might be able to change the install location options in the test cases using

    ChromeOptions options = new ChromeOptions();options.setBinary("/path/to/other/chrome/binary");


Did you specify the -Dwebdriver.chrome.driver=Path/To/ChromeDriver when starting your node?

Adding this may help.