Ubuntu: Install Selenium & ChromeDriver

 

Install required packages

sudo apt-get update
sudo apt-get install -y unzip xvfb libxi6 libgconf-2-4

 

Install Chrome

sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
sudo echo "deb [arch=amd64]  http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
sudo apt-get -y update
sudo apt-get -y install google-chrome-stable

 

Install ChromeDriver

wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
unzip chromedriver_linux64.zip

 

Configure System for ChromeDriver

sudo mv chromedriver /usr/bin/chromedriver
sudo chown root:root /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver

 

Get Selenium-Server-*.jar

wget https://selenium-release.storage.googleapis.com/3.13/selenium-server-standalone-3.13.0.jar

 

Install TestNG.jar

wget http://www.java2s.com/Code/JarDownload/testng/testng-6.8.7.jar.zip
unzip testng-6.8.7.jar.zip

 

Start Selenium Server with ChromeDriver

xvfb-run java -Dwebdriver.chrome.driver=/usr/bin/chromedriver -jar selenium-server-standalone.jar

 

Set Chrome to headless

chromedriver --url-base=/wd/hub