Since this question got much attention and needed a proper solution, which I found this way:
First of all we need proper addons to setup headless tests
Getting the right addons
I am already using following selenium IDE addons
- datadriven v0.2
- flowcontrol v08
- includecommand 1.3
What I need is respective selenium addons which work with selenium core server for which I need
- datadriven_v0.2-core.js
- flowcontrol ( goto_sel08.js)
includecommand ( includeCommand_2.3.js) origional source
since openqa.org does not maintain these addons anymore (probably broken or so) You have to use wayback machine to get js files ( no luck with zip attachments). e g flowcontrol in wayback machine
Since I have done this already and created a gist with some fixes
- datadriven_v0.2-core.js
- flowcontrol ( goto_sel08.js)
- includeCommand_2.3.js
- user-extension.js ( all three of above combined)
Setting up Headless Tests
a) install xvfb ( X Vritual Frame Buffer and firefox )
sudo apt-get update && sudo apt-get install -y xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic xvfb x11-apps firefox
b) create xvfb init script /var/init.d/xvfb
if [ -z "$1" ]; then
echo "`basename $0` {start|stop}"
exit
fi
case "$1" in
start)
/usr/bin/Xvfb :99 -ac -screen 0 1024x768x8 &
;;
stop)
killall Xvfb
;;
esac
c) add to startup script:
sudo update-rc.d xvfb defaults
sudo chmod +x /etc/init.d/xvfb
d) start the xvfb
/etc/init.d/xvfb start
e) Setup selenium Tests (you can put test anywhere)
sudo mkdir /usr/local/SeleniumTests && cd /usr/local/SeleniumTests
checkout/copy your html tests to /usr/local/SeleniumTests
f) create alias to test directory (config file 'selenium_alias') (only allow from localhost)
<IfModule alias_module>
Alias /SeleniumTests/ /usr/local/SeleniumTests/
</IfModule>
<Directory "/usr/local/SeleniumTests/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
sudo mv SeleniumTests/selenium_alias /etc/apache2/sites-avaiable
sudo a2ensite selenium
sudo service apache2 restart
g) update selenium tests data (/usr/local/SeleniumTests/tests/data) e.g change test username/password and baseUrl to test app (which I have in xml file)
h) Download Seleninum Server jar file
sudo mkdir /var/lib/selenium/
sudo wget http://selenium.googlecode.com/files/selenium-server-standalone-2.39.0.jar -o /var/lib/selenium/selenium-server.jar
i) Run the headless /Selenese Tests
export DISPLAY=":99" && java -jar /var/lib/selenium/selenium-server.jar -htmlSuite *firefox https://localhost "/usr/local/SeleniumTests/tests/my_app_smoke_testing_suite.html" "firefox-results.html" -trustAllSSLCertificates -ensureCleanSession -port 5561 -userExtensions /usr/local/SeleniumTests/addons/user-extensions.js
Note I have my selenium addons setup under /usr/local/SeleniumTests/addons
Some of the the steps might not be desirable in all situations.