Tuesday, October 14, 2008

Use Selenium RC in Firefox 3

How to use Selenium RC in Firefox 3

For a while now i have been told that selenium RC does not work in firefox 3. This is a huge bummer for anyone who wants to run functional tests and has to downgrade to firefox 2.

Edit 1/12/2009:
A new version (1.0 beta 2) of selenium RC was released today that fixes this issue once and for all!
get it here. You shouldnt need to do this hack now, unless you want to use the old non-beta version. If you do need to use the old version of selenium, here is how to get it to run firefox 3:

Edit 2/8/2009:
Today i was told that there is a firefox extension that allows you to turn of extension version checking. Also, you can do it by editing about:config.

Today i found a workaround to this problem, which works, and is really simple.

Here is what you need to do:
1. Open selenium-server.jar using winrar
2. locate 2 dirs: customProfileDirCUSTFFCHROME and customProfileDirCUSTFF
3. recursively explore each of those dirs, and when you find a file called install.rdf drag it to some temp location, and edit the following line:
change it to:
4. drag the install.rdf back into the archive and overwrite the old one.
5. do this for all the install.rdf files in those 2 dirs.

you can now use "*firefox" in selenium RC. "*chrome" was giving me problems though, complaining about a malformed rdf file, i might have made a mistake in one of them. Either way, i use *firefox, so it does not matter to me.

if you want, you can get my modified selenium jar here - modified to run in firefox3.
the version of selenium that this jar contains are:

also, there is a 1.0-beta1 compatible modified jar here

Edit 12/10/2008:
Some people have been asking for help with selenium errors in the comments. I cannot help you with those, they are probably specific to what you are doing. If you have question about selenium RC errors, you should try asking them on the Selenium RC User Forums.


  1. thanks a lot for your selenium server !

    I had a problem with firefox 3 and selenium server 1.0 beta 1

    18:02:42.615 INFO - Command request: open[http://xxxxxxxx, ] on session null
    18:02:42.615 ERROR - Exception running command
    java.lang.NullPointerException: sessionId should not be null; has this session been started yet?

    but with your modified server, it works fine ;)

  2. I got Firefox3 to work in OSX but not being able to use the *chrome identifier made it impossible for selenium-rc to login (via https) to the website and subsequently run the tests. Sort of defeats the whole purpose. Not sure what to do now..

  3. @john:
    when i use chrome with this hack i get an error about bad syntax. I suspect its because i made a mistake somewhere, and it would probably be easy to fix if you just did all the steps from scratch, and were extra careful. If that does help and you still get the error, you can try to research the chrome rdf file format, and make sure it is correct. Let me know if you figure this out.

  4. EEEE! thank you!!!))
    ps QA

  5. can you let me know how did you change the files and update the jar file again. I extracted the selenium-server.jar file and did changes to all the install.rdf in the two directories,but am having troubles to update the .jar file again for use. I tries updating the jar file using jar-uf option for the files changed, but it doesn't change the jar file. Can you pls let me know how to do it. Thanks.

  6. @Anonymous:
    i changed the files in the jar without unjaring, i used winrar. if you open the jar with winrar you can overwrite files in the jar by dragging and dropping.

  7. Thanks Mikhail! your blog helped in running firefox3 with SRC. And i got the jar file working and changed with WinRaR!!! thanks again :)

  8. On the Mac I had some some sort of checksum issue using "unzip" to decompress the jar and recompress after making the changes. A co-worker suggested using "jar' which eventually worked after I looked at the "-M" option which does not create a manifest file and uses the existing one when you recompress. After that the server worked without error.

  9. Hi Mikhail,
    I get the same error in IE6 after the tests run, which causes a failure. This is my version:
    #Tue Aug 19 13:21:12 CDT 2008

    I couldn't find a comparable file for iexplorer. Have an idea how to fix this one?


  10. Of course only after I post a message do I find the solution.

  11. @Anonymous:
    if you end up coming back, let me know the solution please.

  12. Hi Mikhail,

    Your 'modified selenium jar ' was really helpful and I could run my test on FF3.
    As you have mention
    "find a file called install.rdf drag it to some temp location, and edit the maxVersion to 4.0.0".
    I did this but still my test was not running on FF3, after using the modified jar I am able to do the same.

    Jus wanted to know whether you have done anything extra in the modified selenium jar to make it gel with FF3.....?


  13. @Ioh:
    i did exactly what was described in the procedure. I ended up modifying some files inside of the jar. One way to find out what i did exactly, and if i actually did something else would be to unjar my jar, and the original, and do a diff on their contents.

  14. Thanks a lot ! now i can launch Firefox 3 using Selenium RC.


  15. Hi,
    I am new to Selenium and I heard from one of my friend that Selenium doesn't support Firefox 1.8 and later versions,even after doing the above changes as "em:maxVersion 2.0.0.*em:maxVersion
    change it to:

    Please help me to fix this issue and I want to use selenium for Firefox 3.X verison.. Thanks in advance..

  16. @Anon:
    if you did exactly what i wrote down, it should work, if not, maybe you can try using my modified jar. If that still does not work you can try contacting me on google chat, my email is koryakATgmail

  17. Fantastic,
    I can't believe that worked.
    Thank you

  18. Thanks for the good work !really good.
    Thanks a lot Mikhail,

  19. Thanks for the good work !really good.
    Thanks a lot Mikhail,

  20. This comment has been removed by the author.

  21. Hi Mikhail,

    Unfortunately for me, it doesn't work. I've tried doing the change to install.rdf files in the jar. That didn't work. I also used the selenium-server.jar (1.0 beta 1) that you've attached here. Selenium launches Firefox but then I get the following error: -

    HTTP ERROR: 400

    Could not proxy http://xxx.xxxxx.xxxxx
    java.net.UnknownHostException: xxx.xxxxx.xxxxx


    Powered by Jetty://

    Please help.


  22. @Venky:
    if firefox opens that means that the jar works. Usually firefox does not even start, and gets stuck at "setting profile" or something like that. It looks to me like you have an "unknown host" error.

  23. @Venky:
    try opening http://www.google.com - does it still have that error?

  24. image not found error is displayed.

  25. selenium :- when i clicked on drop down or any button then this tool is not recongnized. please help me immediately.

  26. i m using firefox version 2.0
    selenium support for this version.

  27. people,
    i cannot provide help for selenium errors, nor can i provide help "immediately" - this is a blog not a chat room. If you need help on those issues you should try the selenium RC user forums.


  28. THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    It works perfect!

  29. Thank you Mikhail. I tried opening google as well... I get the same error. I'm not sure what else I can do to fix this problem. Any help will be appreciated. Thank you.


  30. Just letting you know that we have FF3 fixed in the nightly releases and will be putting out a 1.0 RC or final release that fixes this once and for all. Thanks for your patience and help!

  31. I copied your files but when I executed the tests show me a message "com.thoughtworks.selenium.SeleniumException: Permission denied to get property Window.document"

  32. Thanks for the modified .jar. It worked for me in Intrepid Ibex and Firefox 3. Yippeee!

  33. Just an FYI: We're releasing a new beta of Selenium today that will work with Firefox 3 out of the box. Perhaps you can update this post at the top to indicate that this problem is solved once we get the release out.

  34. @Patrick:
    Thanks for letting me know, ill post a link to the new beta at the top

  35. Hi Mikhail, you are doing an amazing job. Thank you.

    I tried with SRC beta 2 and Firefox 3 - it doesn't work for me. I "Address Not Found" error. Any ideas? Let me know if you need any additional information from me.


  36. This comment has been removed by a blog administrator.

  37. hi thanks to ur modified selenium-server.jar,Now I can run selRC with firefox3...
    good work....

  38. can you send me your modified JAR in email, hydhaval@yahoo.com I followed your method but it seems not helping me out. Deeply appreciate your help

  39. @DHAVAL: i fixed the link to my modified jar. You can now download it from here

  40. Thanks a lot.. It was really helpful, saved a lot of time.

  41. It helps also for Firefox 3.5, thanks.

  42. SRC 1.0.1 works with firefox 3.5.2

  43. Hi Friends,
    According to your Suggestion I Run the interactive shell and reach there and give first command as
    you say: [size=18]cmd=getNewBrowserSession&1=*iehta&2=http://www.google.co.in[/size] But
    I got Result a response code of 500 like Below:

    [code]10:08:10.958 INFO - ---> Requesting http://localhost:11111/selenium-server/driver?cmd=getNewBrowserSession&1=*iehta&2=http://www.google.co.in
    10:08:10.967 INFO - Command request: getNewBrowserSession[*iehta, http://www.google.co.in] on session null
    10:08:10.967 INFO - creating new remote session
    10:08:10.971 WARN - GET /selenium-server/driver/?cmd=getNewBrowserSession&1=*iehta&2=http://www.google.co.in HTTP/1.1
    java.lang.RuntimeException: SystemRoot apparently not set!
    at org.openqa.selenium.server.browserlaunchers.WindowsUtils.findSystemRoot(WindowsUtils.java:275)
    at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.findHTALaunchLocation(HTABrowserLauncher.java:42)
    at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.(HTABrowserLauncher.java:28)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.createBrowserLauncher(BrowserLauncherFactory.java:124)
    at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.getBrowserLauncher(BrowserLauncherFactory.java:81)
    at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:307)
    at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:113)
    at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:78)
    at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:653)
    at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:410)
    at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:388)
    at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:135)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
    at org.mortbay.http.HttpServer.service(HttpServer.java:909)
    at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
    at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
    at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
    at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
    at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
    at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
    Server returned HTTP response code: 500 for URL: http://localhost:11111/selenium-server/driver/?cmd=getNewBrowserSession&1=*iehta&2=http://www.google.co.in

    How this problem can remedy, the selenium RC is running fine , but the problem is that, I am working in
    Fedora core 12 box. Waiting your Fast Reply
    you can reply me at : anes.pa@gmail.com
    Anes P.A

  44. Awesome solution