Selenium and Firefox 3

September 27th, 2008

I recently spent a bit of time making our Selenium tests play nicely with Firefox 3 and spent quite a lot of time starting at

Preparing Firefox profile...

Selenium would launch Firefox, and then Firefox would just sit there doing nothing. Eventually some digging around found a ticket on the Selenium issue tracker. It turns out Selenium installs a tiny little extension into the Firefox profiles it generates that basically just lets selenium kill firefox by telling it to go to a magic chrome url. Firefox extensions specify which versions they are compatible with and the one embedded in selenium had 2.0.0.* as their maximum version (and this is still the case with the latest downloadable release (although you could of course download the nightly builds)).

It seems that this was the only thing from keeping selenium and Firefox 3 playing nicely together as changing the maximum version to 3.0.* got all our tests passing again with our existing version of selenium (0.9.2).

All I had to do was extract the relevant files from selenium-server.jar:

jar xf selenium-server.jar \
customProfileDirCUSTFFCHROME/extensions/readystate@openqa.org/install.rdf
jar xf selenium-server.jar \
customProfileDirCUSTFFCHROME/extensions/{538F0036-F358-4f84-A764-89FB437166B4}/install.rdf
jar xf selenium-server.jar \
customProfileDirCUSTFFCHROME/extensions/\{503A0CD4-EDC8-489b-853B-19E0BAA8F0A4\}/install.rdf 
jar xf selenium-server.jar \
customProfileDirCUSTFF/extensions/readystate\@openqa.org/install.rdf 
jar xf selenium-server.jar \
customProfileDirCUSTFF/extensions/\{538F0036-F358-4f84-A764-89FB437166B4\}/install.rdf

This extracts the files (and the directory structure containing them). To be honest I'm not entirely sure of the difference between all of these extensions - safest bet seems to be changing them all. Now edit all of the .rdf files (they're just text files) and change the maximum version from 2.0.0.* to whatever you want (for example 3.0.*) and put them back in the jar:

jar uf selenium-server.jar \
customProfileDirCUSTFFCHROME/extensions/readystate@openqa.org/install.rdf
jar uf selenium-server.jar \
customProfileDirCUSTFFCHROME/extensions/{538F0036-F358-4f84-A764-89FB437166B4}/install.rdf
jar uf selenium-server.jar \
customProfileDirCUSTFFCHROME/extensions/\{503A0CD4-EDC8-489b-853B-19E0BAA8F0A4\}/install.rdf 
jar uf selenium-server.jar \
customProfileDirCUSTFF/extensions/readystate\@openqa.org/install.rdf 
jar uf selenium-server.jar \
customProfileDirCUSTFF/extensions/\{538F0036-F358-4f84-A764-89FB437166B4\}/install.rdf

Voila! all done

4 Responses to “Selenium and Firefox 3”

  1. Alan Says:
    Thanks for this - I had exactly the same problem. I had actually created a custom FF 2.0 profile previously (to enable XPather, Firebug extensions etc.), but discovered that the Selenium extensions themselves are still within the .jar archive, so the above was still necessary and worked fine on my Mac with copy/paste and simple find/replace of the <em:maxversion> tag values. Now I just have to get rid of an annoying 'services.addons.mozilla.org:443 uses an invalid security certificate' alert that pops up at each launch! Hopefully that's going to be easier to deal with. Alan
  2. Alan Says:
    As a followup to my last comment, I never did find a way to avoid the FF3 security certificate error appearing when Selenium launched Firefox with my custom profile. In the end, I gave up and downloaded the 'nightly build' Selenium RC package (which fixed the Selenium FF extensions issue mentioned above), then proceeded to update the Selenium FF profile within the selenium-server.jar archive with the extensions I wanted, copied from my 'normal' Firefox 3 profile (explained on the Selenium forums here: http://clearspace.openqa.org/message/40837#40837). Now I finally have Selenium RC firing up FF 3 loaded with the extensions I need for debugging (XPather, Firebug) ... and no *?*?* alerts :-) Hope this helps someone... Alan
  3. Rohan Almeida Says:
    This was a big help. Thanks.
  4. Ed Johnson Says:
    Thanks, guys! I went through the steps and I am posting a copy of the Firefox compatible selenium-server-1.0-beta-1 jar here: http://edwardotis.net/public_files/selenium/selenium_server_FF3/selenium-server.jar cheers, Ed

Sorry, comments are closed for this article.