Project

General

Profile

Actions

TestingSelenium » History » Revision 3

« Previous | Revision 3/29 (diff) | Next »
Andreas Kohlbecker, 03/15/2011 11:38 AM


Functional Website Testing with Selenium

We will use Jenkins CI":http://jenkins-ci.org/ in order to run "SeleniumHQ tests headlessly on a Debian server.

Install SeleniumHQ

The Selenium Server is needed in order to run either Selenium RC style scripts or Remote Selenium Webdriver ones.

  1. download the Selenium Standalone Server from http://code.google.com/p/selenium/

Install xvfb

The following installation instructions have been copied from the great guidance on this topic http://www.danstraw.com/running-selenium-tests-on-debian-headlessly-using-iceweasel-and-firefox/2010/11/24/, though we found that we need to install additional packages we decided repeat and extend this guidance here.

To install xvfb:

sudo apt-get install xvfb apt-get libgl1-mesa-dri

And then to check everything’s OK:

Xvfb :99

Where :99 is the display number. We set it to 99 to avoid any conflict with other displays, should they be attached. The command line should just hang without any comments until you press CTRL-C to close.

Install iceweasel (firefox)

To install iceweasel, which is currently the debian version of firefox:

sudo apt-get install iceweasel

And then, once you’re installed, to test that it works OK.

  1. Start Xvfb in one window as above,

  2. then in a second terminal window:

export DISPLAY=:99
firefox

you should see nothing – firefox should just sit there until you CTRL+C.

The “export DISPLAY=:99″ line is telling firefox to use display # 99, which we started above.

we want to take take a screenshot in order to check that everything is ok. We will use ImagMagick for this:

see also http://www.debianroot.de/server/website-screenshots-von-der-linux-consolen-mit-cutycapt-1196.html

apt-get install imagemagick

Updated by Andreas Kohlbecker almost 11 years ago · 3 revisions