views:

137

answers:

1

Question partly answered in http://stackoverflow.com/questions/3481851/selenium-rc-testing-with-maven - basically stating go back to using Firefox 3.5 (but one answer suggesting that does not work). Not an option anyway - 3.6.8 is what we are using.

Anyway, any clue on how to get Maven / Selenium working with Firefox 3.6.x?

I am attempting to use:

<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium</artifactId>
   <version>2.0a5</version>
</dependency>

For dependent Java classes used in the tests.

And:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>selenium-maven-plugin</artifactId>
  <version>1.1-SNAPSHOT</version>
  <executions>
    <execution>
      <phase>pre-integration-test</phase>
      <goals>
        <goal>start-server</goal>
      </goals>
      <configuration>
        <background>true</background>
      </configuration>
    </execution>
    <execution>
      <id>stop-selenium</id>
      <phase>post-integration-test</phase>
      <goals>
        <goal>stop-server</goal>
      </goals>
    </execution>
  </executions>
</plugin>

When I run integration-test against Firefox, I get:

INFO [org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher] Preparing Firefox profile...

ERROR [org.openqa.selenium.server.BrowserSessionFactory] Failed to start new browser session, shutdown browser and clear all session data java.lang.RuntimeException: Firefox refused shutdown while preparing a profile

Caused by: org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher$FileLockRemainedException: Lock file still present! C:\DOCUME~1\XXX\LOCALS~1\Temp\customProfileDirb809d85d6d064be0bdd1a4ee68035cbb\parent.lock at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFileLockToGoAway(FirefoxChromeLauncher.java:269)

A: 

I've had a problem with firefox and Selenium RC.

The solution was to edit the selenium RC jar files. Open them up in WINRAR (or similar) and browse through the folders for

 selenium-server.jar\customProfileDirCUSTFF\extensions\*
 selenium-server.jar\customProfileDirCUSTFFCHROME\extensions\*

Open up the files you see called "Install.rdf"

    <Description about="urn:mozilla:install-manifest">
        <em:id>[email protected]</em:id>
        <em:type>2</em:type>
        <em:name>DocumentReadyState</em:name>
        <em:version>1.0</em:version>
        <em:description>Provides a mechanism to update the document readyState property</em:description>

        <!-- Firefox -->
        <em:targetApplication>
            <Description>
                <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                <em:minVersion>1.4.1</em:minVersion>
                <em:maxVersion>3.6.*</em:maxVersion>
            </Description>
        </em:targetApplication>
    </Description>
</RDF>

And see where it says MaxVersion? Bump that up to say ... 4.6
Save the file and overwrite the original install.rdf in the .jar

Then... selenium is happy.

I really apologise for wating your time if this doesn't work. It was a hack that I found after a few hours / days of scrambling.

... EDIT ... Oh beans I just read the error message from above. Nowhere near the same issue. Yours is something to do with a lockfile or previous firefox session.

Tried a clear history/reset to factory defaults in the browser and similar?

Alex C
As you suspected, changing the maxVesion did not work for me. Problem is not related to clearing history, etc. Selenium just seems not to support Firefox 3.6 when run from Maven.
Steve