Running Selenium Tests with ChromeDriver on Linux

by seetaram on August 17, 2011

Some of the pre-requisites has to be setup to execute the Selenium WebDriver tests with chromedriver on Linux

Download the following Softwares before starting to write tests in eclipse.

  1. Download Google Chrome – Chrome for Linux
  2. Download ChromeDriver – ChromeDriver for Linux

Install the Google Chrome on the Linux ennvironment by using the following methods:

  1. Double click or use rpm command if the package is “.rpm” (am currently using Fedora) to install the google chrome
  2. Use apt-get / YUM command to download and then install the package for different Linux flavors accordingly

Executing ChromeDriver Server:

  1. Inside /home/${user} – create a new directory “ChromeDriver”
  2. Unzip the downloaded chromedriver into this folder
  3. Using chmod +x filename or chmod 777 filename make the file executable
  4. Go to the folder using cd command
  5. Execute the chrome driver with ./chromedriver command
  6. Now the chromedriver will start executing in the 9515 port
[seetaram@Linux chromedriver]$ ./chromedriver
Started ChromeDriver

Above is the output of the chromedriver server executing in Linux terminal.

After the above is accomplished, try to setup the test on the eclipse

  1. Download the Selenium server 2.0
  2. Download JUnit
  3. Unzip both the files and configure them to build path in the eclipse
  4. Write the test code as below in the Eclipse – Java file
package com.selftechy.wdriver;


import org.junit.*;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

public class ChromeRemoteDriver {
    public static void main(String []args) throws MalformedURLException{
        new DesiredCapabilities();
            URL serverurl = new URL("http://localhost:9515");
            DesiredCapabilities capabilities =;
            WebDriver driver = new RemoteWebDriver(serverurl,capabilities);
        WebElement searchEdit = driver.findElement("q"));
        searchEdit.sendKeys("Selftechy on google");


Now, try to execute the code by clicking Run As –> JUnit Test.  It should be executing the test to the completion.

{ 6 comments… read them below or add one }

afam April 25, 2013 at 12:03 am

Thank you very much. That was great tip. It pointed me to the right direction. My only ask is to add more detail on how to configure and setup the chromedriver on eclipse. I believe you have to set the system property but how.


Manoj October 7, 2013 at 7:18 am

Your last line creating confusion “try to execute the code by clicking Run As –> JUnit Test. It should be executing the test to the completion”. Change it as “Java Application” or change the code in junit.


seetaram October 8, 2013 at 9:21 am

You are misunderstanding… If you are trying to run JUnit test then you should use RunAs –> JUnit Test, If it is a Java program with main() method then you should use “Java Application”


Sachin September 26, 2014 at 7:36 am

Thanks for this. But i am getting an error that The driver is not executable, when i try to run the code on bamboo.


Divya December 14, 2017 at 8:09 am

Chrome : version : 63.0.3239.84 (Official Build) (64-bit)
Chromedriver : 2.34
Selenium server : 3.7.1

still unable to execute, getting the below error
Could someone please help me in resolving the issue. struggling and searching for answer from many days.

Starting ChromeDriver 2.34.522913 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5) on port 11458

Only local connections are allowed.

Exception in thread “main” org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally

(Driver info: chromedriver=2.34.522913
4.10.0-28-generic x86_64) (WARNING: The server did not provide any
stacktrace information)

Command duration or timeout: 60.10 seconds


seetaram December 25, 2017 at 10:07 am

Hi Divya,

There is some issue with the Chrome. Try to update the chrome to latest version. Wherever you get this error, at that point in the code try to wait for some time. I mean use some sleep time. That should solve your problem.


Leave a Comment

Previous post:

Next post:

Do you want to get updates on the recent articles written? Please subscribe to RSS feed or Email