Last active
September 14, 2020 09:00
-
-
Save schneefisch/dc947a293a13a5ea12a102db19d16321 to your computer and use it in GitHub Desktop.
How to install Selenium-HQ with Google-Chrome on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# IMPORTANT: Update the STANDALONE_Version variable | |
# | |
# LINK: | |
# how to install selenium and chrome-driver on Ubuntu | |
# https://gist.github.com/ziadoz/3e8ab7e944d02fe872c3454d17af31a5 | |
# | |
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/ | |
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c | |
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver | |
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception | |
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal | |
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04 | |
# Versions | |
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` | |
SELENIUM_STANDALONE_VERSION=3.141.59 | |
SELENIUM_SUBDIR=$(echo "$SELENIUM_STANDALONE_VERSION" | cut -d"." -f-2) | |
# Remove existing downloads and binaries so we can start from scratch. | |
rm ~/google-chrome-stable_current_amd64.deb | |
rm ~/selenium-server-standalone-*.jar | |
rm ~/chromedriver_linux64.zip | |
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 https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -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 | |
rm ~/google-chrome-stable_current_amd64.deb | |
# Install ChromeDriver. | |
wget -N http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -P ~/ | |
unzip ~/chromedriver_linux64.zip -d ~/ | |
rm ~/chromedriver_linux64.zip | |
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 http://selenium-release.storage.googleapis.com/$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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment