Skip to content

Instantly share code, notes, and snippets.

@eirenik0
Forked from curtismcmullan/setup_selenium.sh
Last active April 4, 2017 21:30
Show Gist options
  • Save eirenik0/21eaf6488ed5b24d29d806eea6dff10b to your computer and use it in GitHub Desktop.
Save eirenik0/21eaf6488ed5b24d29d806eea6dff10b to your computer and use it in GitHub Desktop.
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
#
echo "\r\nCreating folder to place selenium in ...\r\n"
sudo mkdir ~/selenium
cd ~/selenium
# Get Selenium and install headless Java runtime
#
echo "\r\nInstalling Selenium and headless Java runtime ...\r\n"
sudo wget http://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar
sudo apt-get install openjdk-8-jre-headless -y
# Install Firefox and geckodriver
#
echo "\r\nInstalling Firefox ...\r\n"
sudo apt-get install firefox -y
wget https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-linux64.tar.gz
tar -xvzf geckodriver-v0.11.1-linux64.tar.gz
rm geckodriver-v0.11.1-linux64.tar.gz
chmod +x geckodriver
sudo cp geckodriver /usr/local/bin/
# Install headless GUI for firefox. 'Xvfb is a display server that performs graphical operations in memory'
#
echo "\r\nInstalling XVFB (headless GUI for Firefox) ...\r\n"
sudo apt-get install xvfb -y
# Finally, starting up Selenium server
#
echo "\r\nStarting up Selenium server ...\r\n"
DISPLAY=:1 xvfb-run java -jar ~/selenium/selenium-server-standalone-3.0.1.jar "$SELENIUM_ARGS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment