running selenium tests on a headless bamboo
Mon, Apr 2, 2012
With Selenium requiring a browser to run the tests, if you don’t have one installed you’ll get the error:
sessionId should not be null; has this session been started yet?You’ll also get this error if you have a valid browser configured in the test code but not installed on the system. However the problem with running Selenium tests on a headless Bamboo server is, there’s no display. So here’s how to sort that on Suse Linux.
Install Xvfb from yast2 and the xorg-x11-server package
Startup Xvfb in the background:
Xvfb :99 -ac &and set the display to use the one you chose. I normally do this in / etc/profile.
export DISPLAY=:99Then exit and go back into the shell or do:
source / etc/profilestart and stop Bamboo and the Selenium tests will run.