Testing websites in Google-Chrome using Cucumber

Howto install Chrome, Cucumber, Capybara and Selenium.

Afterwards we run a simple example test against the Chrome browser.

Install a fresh virtual machine with Ubuntu 11.10.
Make sure you install all the updates, this is needed for the latest Chrome version.

sudo apt-get update
sudo apt-get dist-upgrade
reboot

sudo apt-get install ruby
sudo apt-get install rubygems
sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev
sudo apt-get install openjdk-6-jre

sudo gem install rubygems-update
sudo update_rubygems

sudo gem install rspec
sudo gem install cucumber (gives error on builder documentation, ignore)
sudo gem install capybara


install the latest version of Chrome
download the latest chromedriver

  • extract chromedriver from zipfile
  • sudo cp chromedriver /usr/bin

download latest selenium-server

  • start the selenium-server “java -jar selenium-yourversion.jar”

download my example feature file Example.zip

  • unzip my example.zip
  • start cucumber from the Example directory

See my short screencast for how it should work out.

The whole process should take you about 40 minutes to a hour, depending on your computer and internet speeds.

Be Sociable, Share!

Written by Niels van Reijmersdal

February 14th, 2012 at 19:45

Leave a Reply