TestingSelenium » History » Revision 8
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.
The Selenium Server is needed in order to run either Selenium RC style scripts or Remote Selenium Webdriver ones.
- download the Selenium Standalone Server from http://code.google.com/p/selenium/
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:
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.
Start Xvfb in one window as above,
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 to take screen shots in addition we also install the x11-utils in order get the
apt-get install imagemagick x11-utils
Now take a screenshot of the
export DISPLAY=:99 import -window root example.png
The screenshot would look like this:
If you want to get a list of all windows currently managed by Xvfb :
xwininfo -root -tree