Have you just updated your shiny Firefox to version 3.6 and now you
can’t make Selenium 1.0.1 (precisely: selenium-rc-0.1.1) working fine
for you on this browser? Ooops… I got the same.
Now, when you try to run one of your Selenium based UI tests on such a
brand-new-and-up-to-date “combo” it just fails to start the browser and
there is just some annoying exceptions in logs, similar to these:
ERROR - Failed to start new browser session,
shutdown browser and clear all session data java.lang.RuntimeException:
Firefox refused shutdown while preparing a profile
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher$
FileLockRemainedException: Lock file still present!
C:\DOCUME~1\{windows-username}\LOCALS~1\Temp\customProfileDir197b3da3c02244fb8407912c5e126b07\parent.lock
Caused by: com.thoughtworks.selenium.SeleniumException: Failed
to start new browser session: Unable to delete file
C:\DOCUME~1\{windows-username}\LOCALS~1\Temp\customProfileDir197b3da3c02244fb8407912c5e126b07\parent.lock
There is a cure. A bit hacky, but still worth to try, if you really
need to use Firefox 3.6.
So do some search through your project dependencies JARs and find
selenium-server.jar item. Unzip it, find all (of 5) “install.rdf” files
inside this JAR (they are under customProfileDirCUSTFF and
customProfileDirCUSTFFCHROME subfolders), open them in some text editing
tool (they are XML based configuration files) and replace the max
version of agent (browser) application from line like this:
<em:maxVersion>3.5.*</em:maxVersion>
into this:
<em:maxVersion>3.6.*</em:maxVersion>
Or just download customized selenium-server.jar (pathed, as above, to
Firefox 3.6.*) fromthis
place.
Note: If you are using Grails with Selenium plugin
(selenium-rc-0.1.1), you can find selenium-server.jar in your project
plugins folder (e.g.
{user-home}\.grails\{grails-version}\projects\{project-name}\plugins\selenium-rc-0.1.1\lib\server)
Where:
{user-home}stands for user home folder, e.g.
C:\DOCUME~1\johndoe or C:\Users\johndoe
{grails-version}is Grails version, e.g. 1.1
{project-name}is your Grails project name, e.g. test-project
Done. It should work now!