Selenium on Ubuntu Hardy Heron
Ubuntu 8.04, the Hardy Heron, was released last week. I eagerly upgraded to see if my previous wireless networking issues had been resolved, and joy of joys they had! This allowed me to finally switch back to Ubuntu as my primary development environment.
Most of the switch went without a hitch, however I did encounter one problem. The acceptance tests for Pulse rely heavily on Selenium. When trying to launch Selenium on Hardy, Selenium RC always got stuck at:
Preparing Firefox profile…
The default version of Firefox installed with Hardy is Firefox 3 beta 5 – as opposed to Firefox 2 in previous releases. So it seems that Selenium and Firefox 3 don’t agree with each other – or at least not when using the current release of Selenium (1.0-b1). My best guess is that Selenium is trying to install extensions into Firefox but is failing as the compatible versions for the extensions don’t include Firefox 3. A better diagnostic would be nice!
In any case, the easiest resolution was to install Firefox 2, which can sit alongside Firefox 3 on Hardy. Just install the firefox-2 package:
Then make sure Selenium uses this version. One way to do this is to create a link named firefox-bin in your PATH that points to the Firefox 2 binary. However, I prefer to leave my system clean and make an exception just for Selenium. To allow this, our tests support an optional SELENIUM_BROWSER environment variable that specifies in Selenium format the browser to use (this comes in handy in other cases too). So before running tests, I ensure that SELENIUM_BROWSER is set:
To make this my default with no extra effort, I have actually just added it to my .bashrc.
This entry was posted on Thursday, May 1st, 2008 at 5:31 am and is filed under Agile, Technology, Testing. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.










July 1st, 2008 at 9:39 pm
naro says:Thanks! This blog entry solved exactly the same problem I had with Firefox 3 on Mac OS X. I copied Firefox.app to Firefox2.app before installing FF3 and solved Selenium problem with:
export SELENIUM_BROWSER=’*firefox /Applications/Firefox2.app/Contents/MacOS/firefox-bin’
July 16th, 2008 at 1:34 pm
Paulo says:Hi, I had the same issue and found this website via google. I just tried the nightly build and it’s fixed. Selenium would get stuck waiting for the user to accept the EULA. You can see in the source code (LauncherUtils.java) that they put a workaround for this.
July 22nd, 2008 at 12:40 am
Radek says:Hi
I have the same problem. I’ve tried your sollution, but when I install firefox 2 and try running firefox-2-bin I get:
15:33:39.062 INFO – Preparing Firefox profile…
/usr/lib/firefox/firefox-2-bin: error while loading shared libraries: libmozjs.so: cannot open shared object file: No such file or directory
The library file IS in /usr/lib/firefox which is on the PATH environment.
Any ideas how to pass this?
September 2nd, 2008 at 3:40 pm
Vinod Pandey says:view /etc/ld.so.conf
add enty for library of firefox in .conf file listed in the above file
for example add /usr/lib/firefox in
/etc/ld.so.conf.d/libc.conf
then sudo su –
lddconfig
or ldconfig
September 3rd, 2008 at 1:06 am
Larry Zoumas says:As we say in Sweden… ‘Tusen Tack!’ (one thousand thank yous!)
November 24th, 2008 at 2:04 am
Niels says:I could not get the above to work, but what I found here worked:
http://willbryant.net/software/2008/05/26/selenium_rc_firefox_2_on_ubuntu_hardy
sudo apt-get install firefox-2
sudo ln -s /usr/lib/firefox/firefox-2-bin /usr/lib/firefox/firefox-bin
January 4th, 2009 at 8:14 am
chrispanda says:see
http://rubythings.blogspot.com/
for an alternative that might work – it worked for me on interpid ibex