Project

General

Profile

TestingSelenium » History » Version 5

Andreas Kohlbecker, 03/15/2011 11:47 AM

1 1 Andreas Kohlbecker
2
3
## Functional Website Testing with Selenium
4
5
6 2 Andreas Kohlbecker
We will use [Jenkins CI":http://jenkins-ci.org/ in order to run "SeleniumHQ](http://seleniumhq.org/) tests headlessly on a Debian  server.
7 1 Andreas Kohlbecker
8
9
10
### Install SeleniumHQ
11
12
13
The Selenium Server is needed in order to run either Selenium RC style scripts or Remote Selenium Webdriver ones.
14
15
16
1. download the Selenium Standalone Server from http://code.google.com/p/selenium/
17
18
19
20
### Install xvfb
21
 
22
23 2 Andreas Kohlbecker
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.
24 1 Andreas Kohlbecker
25
26
To install xvfb:
27
28
~~~
29 4 Andreas Kohlbecker
sudo apt-get install xvfb apt-get libgl1-mesa-dri x11-utils
30 1 Andreas Kohlbecker
~~~
31
And then to check everything’s OK:
32
33
~~~
34
Xvfb :99
35
~~~
36
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.
37 2 Andreas Kohlbecker
38
39
40
### Install iceweasel (firefox)
41
42
43
To install iceweasel, which is currently the debian version of firefox:
44
45
~~~
46
sudo apt-get install iceweasel
47
~~~
48
And then, once you’re installed, to test that it works OK. 
49
50
1. Start Xvfb in one window as above, 
51
52
1. then in a second terminal window:
53
54
~~~
55
export DISPLAY=:99
56
firefox
57
~~~
58
you should see nothing – firefox should just sit there until you CTRL+C.
59
60
The “export DISPLAY=:99″ line is telling firefox to use display # 99, which we started above.
61
62
63
we want to take take a screenshot in order to check that everything is ok. We will use ImagMagick for this:
64
65 5 Andreas Kohlbecker
see also:
66
67
* http://www.debianroot.de/server/website-screenshots-von-der-linux-consolen-mit-cutycapt-1196.html
68
69
* http://linuxwiki.de/BildschirmFoto
70 3 Andreas Kohlbecker
71 2 Andreas Kohlbecker
~~~
72
apt-get install imagemagick
73
~~~