Skip to content

Instantly share code, notes, and snippets.

@dhensby
Created April 20, 2016 19:52
Show Gist options
  • Save dhensby/594b4b1d700c2fa9e0b685ac2ebf4145 to your computer and use it in GitHub Desktop.
Save dhensby/594b4b1d700c2fa9e0b685ac2ebf4145 to your computer and use it in GitHub Desktop.
Selenium, Firefox and Behat on CentOS 7 RHEL 7 and fedora
#!/usr/bin/env bash
# help from:
# https://gist.github.com/textarcana/5855427
# http://tecadmin.net/install-firefox-on-linux/
# install deps
yum install -y java Xvfb firefox
# This version of FF doesn't actually work with latest selenium (for me) so I remove it again
# We initially install firefox with yum so all the deps are included
yum remove -y firefox
# get selenium server
wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar
# move it to a known location
mv selenium-server-standalone-2.53.0.jar /opt/selenium-server-standalone.jar
# install latest extended release FF
wget http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/45.0/linux-x86_64/en-US/firefox-45.0.tar.bz2
tar -xvjf firefox-45.0.tar.bz2
mv firefox /usr/local/firefox
ln -s /usr/local/firefox/firefox /usr/local/bin/firefox
# create a fake monitor
Xvfb :99 -ac -screen 0 1280x1024x24 &> /dev/null &
# export the environment var for Firefox
echo "export DISPLAY=:99" >> ~/.profile
# run the server
java -jar /opt/selenium-server-standalone.jar &> /dev/null &
# Ready to run behat tests
echo "done"
@zhongwanshi
Copy link

What output do I supposed to see after I run the server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment