Skip to content

Instantly share code, notes, and snippets.

@mamontovdmitriy mamontovdmitriy/ forked from ziadoz/
Last active Oct 21, 2017

What would you like to do?
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# Versions
# Remove existing downloads and binaries so we can start from scratch.
rm ~/google-chrome-stable_current_amd64.deb
rm ~/selenium-server-standalone-*.jar
rm ~/
sudo rm /usr/local/bin/chromedriver
sudo rm /usr/local/bin/selenium-server-standalone.jar
# Install dependencies.
sudo apt-get update
sudo apt-get install -y unzip openjdk-8-jre-headless xvfb libxi6 libgconf-2-4
# Install Chrome.
wget -N -P ~/
sudo dpkg -i --force-depends ~/google-chrome-stable_current_amd64.deb
sudo apt-get -f install -y
sudo dpkg -i --force-depends ~/google-chrome-stable_current_amd64.deb
# Install ChromeDriver.
unzip ~/ -d ~/
rm ~/
sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
sudo chown root:root /usr/local/bin/chromedriver
sudo chmod 0755 /usr/local/bin/chromedriver
# Install Selenium.
wget -N$SELENIUM_SUBDIR/selenium-server-standalone-$SELENIUM_STANDALONE_VERSION.jar -P ~/
sudo mv -f ~/selenium-server-standalone-$SELENIUM_STANDALONE_VERSION.jar /usr/local/bin/selenium-server-standalone.jar
sudo chown root:root /usr/local/bin/selenium-server-standalone.jar
sudo chmod 0755 /usr/local/bin/selenium-server-standalone.jar
#!/usr/bin/env bash
# Run Chrome via Selenium Server
start-chrome() {
xvfb-run java"localhost,,192.168.*.*" -jar /usr/local/bin/selenium-server-standalone.jar
start-chrome-debug() {
xvfb-run java"localhost,,192.168.*.*" -jar /usr/local/bin/selenium-server-standalone.jar -debug
# Run Chrome Headless
start-chrome-headless() {
chromedriver --url-base=/wd/hub
# Start
# start-chrome-debug
# start-chrome-headless
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.