// ThomasWeller

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


News

Stack Overflow profile for Thomas Weller
Thomas Weller on bitbucket.org


Gallio Banner

Mercurial

Typemock Isolator

Can’t code without   The best C# coding assistance and
    refactoring plugin for Visual Studio

My Stats

  • Posts - 43
  • Comments - 128
  • Trackbacks - 0

Tag Cloud


Recent Comments


Recent Posts


Archives


Post Categories


Free e-Books


Toolbox: Development


Toolbox: Documentation


Toolbox: Productivity


Toolbox: Static analysis


Toolbox: Testing


Toolbox: Textual analysis



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
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Comments

Gravatar # re: Making Selenium 1.0.1 work with Firefox 3.6
Posted by Dan Garland on 5/3/2010 4:22 PM
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,
Gravatar # re: Making Selenium 1.0.1 work with Firefox 3.6
Posted by bwilder on 5/17/2010 9:22 PM
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?
Gravatar # re: Making Selenium 1.0.1 work with Firefox 3.6
Posted by Thomas Weller on 5/18/2010 6:41 AM
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
Gravatar # re: Making Selenium 1.0.1 work with Firefox 3.6
Posted by bwilder on 5/19/2010 1:35 PM
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!
Gravatar # re: Making Selenium 1.0.1 work with Firefox 3.6
Posted by lp9999 on 6/2/2010 2:48 PM
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.

Gravatar # re: Making Selenium 1.0.1 work with Firefox 3.6
Posted by Tanya on 6/17/2010 4:07 PM
Hi! I was able to move from "Preparing Firefox profile..." status to "Launching Firefox...". However, it hangs from there :( Any ideas?
Gravatar # Simplifies management of Selenium Remote Control.
Posted by BlueDuck on 6/18/2010 6:52 PM
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/



Gravatar # re: Making Selenium 1.0.1 work with Firefox 3.6
Posted by Dmitrijs Zaharovs on 7/9/2010 4:50 PM
Thanks!
Great solution. Works for me.
Gravatar # re: Making Selenium 1.0.1 work with Firefox 3.6
Posted by Steven M. Cherry on 10/21/2010 8:37 PM
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!
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: