Skip to content

Instantly share code, notes, and snippets.

@estahn
Created June 30, 2011 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save estahn/1055981 to your computer and use it in GitHub Desktop.
Save estahn/1055981 to your computer and use it in GitHub Desktop.
Headless Testing for Continuous Integration with Ruby and Selenium
# Install and run xvfb
apt-get install xvfb
Xvfb -ac :99
# Get Firefox
wget -O firefox-5.0.tar.bz2 "http://download.mozilla.org/?product=firefox-5.0&os=linux&lang=en-US"
tar xfj firefox-5.0.tar.bz2
mv firefox firefox-5.0
# Get Selenium Server
wget http://selenium.googlecode.com/files/selenium-server-standalone-2.0rc3.jar
# Start Selenium Server
DISPLAY=:99 java -jar selenium-server-standalone-2.0rc3.jar -Dwebdriver.firefox.bin=<firefox path>/firefox-5.0/firefox-bin
# Install gem
gem install selenium-webdriver
# Test it
irb
require "selenium-webdriver"
driver = Selenium::WebDriver.for(:remote)
driver.navigate.to "http://google.com"
driver.title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment