These days, I’m doing a bit of end-to-end acceptance web testing using the Selenium framework. Selenium has a nice and handy add-on for the Firefox browser – the Selenium IDE. It automatically records your actions and produces the required C# code for you, as you click around in the browser window.
But when I started the Selenium server and tried to run my first test (copied from the Selenium docs), it didn’t work (Sigh. It never works on the first try…) and I got a timeout and an exception. This is what my Gallio test report showed:
Huh? A file could not be deleted (obviously a temporary file that is internally used by the browser)? The Selenium docs were not of much help here.
When I thought it over for a minute, I started to suspect what the real, underlying problem could be: I’m using the new 3.6 version of Firefox, which is about half a year more recent than the current Selenium release. So it might be again an incarnation of our good old friend named ‘version mismatch’… Searching Google for ‘selenium firefox 3.6’ quickly revealed that I was right: the problem simply is that the Selenium server only accepts Firefox versions up to 3.5. This can easily be corrected. Here’s how:
--- Remark: The following solution includes the usage of the free 7-Zip file archiver. --
1. In Windows Explorer, go to the directory where your Selenium server is located (i.e. where the ‘selenium-server.jar’ file lives). After you made a backup of the original file, open it directly with 7-Zip (a *.jar file is actually a compressed archive).
2. We need to patch five instances of a file called ‘install.rdf’ (they actually are small xml files). These files can be found at the following locations in the ‘selenium-server.jar’ archive:
3. Open each of these files (directly from within 7-Zip) with Notepad or any other text/xml editor. Replace the following text…
… with this (you might have guessed it already):
4. Notepad (or your favorite text/xml editing tool) will ask you to confirm your changes, and so will 7-zip immediately after the file change. Confirm all, close the archive after you’re done, and start the selenium server as usual.