Geeks With Blogs
// ThomasWeller C#/.NET software development, software integrity, life as a freelancer, and all the rest

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:

SeleniumException

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:

  • customProfileDirCUSTFF/extensions/

        {538F0036-F358-4f84-A764-89FB437166B4}

        readystate@openqa.org

  • customProfileDirCUSTFFCHROME/extensions/

        {503A0CD4-EDC8-489b-853B-19E0BAA8F0A4}

        {538F0036-F358-4f84-A764-89FB437166B4}

        readystate@openqa.org

3. Open each of these files (directly from within 7-Zip) with Notepad or any other text/xml editor. Replace the following text…

<em:maxVersion>3.5.*</em:maxVersion>

… with this (you might have guessed it already):

<em:maxVersion>3.6.*</em:maxVersion>

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.

Happy testing…

 

kickit
shoutit
delicious facebook digg reddit linkedin stumbleupon technorati mrwong yahoo google-48x48 twitter email favorites
Posted on Sunday, February 14, 2010 10:00 AM Automation | Back to top


Comments on this post: Making Selenium 1.0.1 work with Firefox 3.6

# re: Making Selenium 1.0.1 work with Firefox 3.6
Requesting Gravatar...
Thanks for this post, I wasn't going to spot this in a million years, but it solved the problem of my cucumber selenium tests hanging mysteriously on "Preparing firefox profile" when running on Ubuntu 10.0.4

Cheers,
Left by Dan Garland on May 03, 2010 4:22 PM

# re: Making Selenium 1.0.1 work with Firefox 3.6
Requesting Gravatar...
Great post, but I'm having a hard time getting it to work for me. I'm admittedly pretty new to Eclipse,Cubictest, and Selenium. I was able to find and update the install.rdf files in the specified locations in <eclipseinstalldir>\plugins\org.cubictest.exporters.selenium_1.9.6.jar\lib\cubictest-selenium-rc-1.9.6.jar, but I can't seem to get Eclipse or Cubictest to recognize the change.

Any thoughts?
Left by bwilder on May 17, 2010 9:22 PM

# re: Making Selenium 1.0.1 work with Firefox 3.6
Requesting Gravatar...
Hi Brendan,
thanks for the positive feedback.
Unfortunately, I don't know Eclipse/Cubictest. So I can't say much, except some platitudes like this:
Is there another instance of Selenium somewhere on your disk? Did you restart everything after the change?

- Thomas
Left by Thomas Weller on May 18, 2010 6:41 AM

# re: Making Selenium 1.0.1 work with Firefox 3.6
Requesting Gravatar...
The only instance I have running is what was installed with cubictest (Selenium RC). I did try restarting, but it didn't help. I also modified the cubictest-selenium-rc-2.0.3.jar in my package's library and that didn't seem to help either.

I'm certain it's something simple I'm missing. Back to the drawing board.

Thanks again!
Left by bwilder on May 19, 2010 1:35 PM

# re: Making Selenium 1.0.1 work with Firefox 3.6
Requesting Gravatar...
I thought I was using selenium-server.jar 1.0.3 but I still got the error. Then I searched and renamed every copy of selenium-server.jar to of selenium-server.jar_old, which caused NUnit to reveal that Selenium was actually looking for version 1.0.1. Then it occurred to me to look in machine.config where I found an entry I had forgotten:

<appSettings>
<add key="SeleniumServerJarPath" value="C:\Program Files\selenium\selenium-remote-control-1.0.1\selenium-server-1.0.1\selenium-server.jar"/>
</appSettings>

When I commented it out NUnit started using Selenium-server.jar 1.0.3 and I no longer got the parent.lock error.
Left by lp9999 on Jun 02, 2010 2:48 PM

# re: Making Selenium 1.0.1 work with Firefox 3.6
Requesting Gravatar...
Hi! I was able to move from "Preparing Firefox profile..." status to "Launching Firefox...". However, it hangs from there :( Any ideas?
Left by Tanya on Jun 17, 2010 4:07 PM

# Simplifies management of Selenium Remote Control.
Requesting Gravatar...
Poject open source - BlueDuck SRC beta version is available.Simplifies
management of Selenium Remote Control. Install and manage the Selenium
server in just a few steps. Allows you to modify graphically selenium
server startup options
(For moment the documentation is only in Spanish.)

https://sourceforge.net/projects/blueducksrc/
http://blueducksrc.sourceforge.net/


Left by BlueDuck on Jun 18, 2010 6:52 PM

# re: Making Selenium 1.0.1 work with Firefox 3.6
Requesting Gravatar...
Thanks!
Great solution. Works for me.
Left by Dmitrijs Zaharovs on Jul 09, 2010 4:50 PM

# re: Making Selenium 1.0.1 work with Firefox 3.6
Requesting Gravatar...
Thanks for this solution! I just tripped over this. We use Selenium to test our whole GUI and also to automatically produce screen-shots for us, and the screen-shot feature only works in FireFox - which is now back up and running.

Cheers!
Left by Steven M. Cherry on Oct 21, 2010 8:37 PM

# re: Making Selenium 1.0.1 work with Firefox 3.6
Requesting Gravatar...
I have selenium's that were created with FF3.5, I am using a grid and the latest version of selenium and most of my test are failing, some of the error messages are
"Could not start Selenium session: ERROR: No available remote control for environment 'Firefox 3.5 on Windows'"

java.lang.NullPointerException

URL of http://(URL....)-head.web is horked java.net.SocketException: Connection reset
Left by JHope on Jan 04, 2013 7:57 PM

Your comment:
 (will show your gravatar)


Copyright © Thomas Weller | Powered by: GeeksWithBlogs.net | Join free