Selenium and Fitnesse (WebTest) with Firefox 3

Just wanted to pass something on…

I’ve been using WebTest on Fitnesse for a while but had issue when trying to use it on my Mac.  I found that the problem was with the Selenium server jar.  You have to hack the jar to get it up and running, but the hack is pretty simple.  Here’s a URL detailing what must be done:

For my own benefit, I’ll reiterate what the other blog stated.  First off, here’s the symptom.  When you try to bring up an instance of Firefox 3 through WebTest (or Selenium test via Fitnesse) you’ll notice that the running Selenium server instance freezes.  If you are running the Selenium server in a Console/Terminal window, you’ll see the following:

Preparing Firefox profile…

The source of the problem is in the *.rdf files inside the jar.  The Selenium (0.9.2) folks hardcoded a version ceiling for Firefox at version 2.0.0.*.  This was a bit of a rude discovery, but I’m ever grateful to the referenced blogger for pointing this out.  I thought it was a Mac thing, but once I finally got a Windows VM running I saw the same behaviour.  The fix is really simple.

Step 1: Extract the files needing change (from the directory where you have the jar).

jar xf selenium-server.jar customProfileDirCUSTFFCHROME/extensions/
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/
jar xf selenium-server.jar customProfileDirCUSTFF/extensions/{538F0036-F358-4f84-A764-89FB437166B4}/install.rdf

Step 2: Change the max version in the rdf (Resource Description Framework) files.

The line of interest looks like this: <em:maxVersion>2.0.0.*</em:maxVersion>

* you can change this to 4.*, should buy some time.

Step 3: Update the jar with your changes.

jar uf selenium-server.jar customProfileDirCUSTFFCHROME/extensions/
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/
jar uf selenium-server.jar customProfileDirCUSTFF/extensions/{538F0036-F358-4f84-A764-89FB437166B4}/install.rdf

That’s it, once that’s changed you should be good to go for testing against Firefox 3!

Now getting (0.9.2) to work with Safari…I’m still figuring that one out.  I tried using {*safari} for the browser, but it hangs.  I may need to try to use the 1.0 version of Selenium server once it’s released.

About Joshua Lockwood

I code stuff and people pay me for it.
This entry was posted in Acceptance Testing, Agile, Best Practices, Fitnesse, Selenium, WebTest. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>