Unable to bypass "Lock File still present" when attempting to run Selenium JUnit Test in maven build

Viewed 506

I am using maven to run JUnit Selenium tests as part of the build. I get the error shown in the stack trace below.

I looked at essentially all other relevant posts out there, but none address the issue of the latest version of Firefox and Selenium (2.4.0) and the issue still happening. Most past posts claim that this issue is fixed with the Selenium 1.0.3 and beyond.

Furthermore, I tried to go to the location of the parent.lock file to delete it as a work-around, but the .lock file was not visible. I tried specifying an alternate firefox profile, but this doesn't seem to matter either.

Why is it not allowing me to open Firefox when it is specifying a .lock file that does not exist? (I have "View hidden files/folders" turned on)

Also, here is my pom.xml's plugin XML:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>selenium-maven-plugin</artifactId>
    <version>2.3</version>
    <configuration>
        <browser>*firefox</browser>
        <suite>mywar/src/test/com/company/myapp/seleniumtest/GPATestSuite.java</suite>
        <startURL>http://localhost:8080</startURL>
    </configuration>
    <executions>
        <execution>
            <id>run-selenium-tests</id>
        <phase>integration-test</phase>
        <goals>
            <goal>selenese</goal>
        </goals>
        <configuration>
            <firefoxProfileTemplate>selenium</firefoxProfileTemplate>
        </configuration>
        </execution>
    </executions>
</plugin>

Stack trace:

Execution run-selenium-tests of goal org.codehaus.mojo:selenium-maven-plugin:2.3:selenese failed: Firefox refused shutdown while preparing a profile
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution run-selenium-tests of goal org.codehaus.mojo:selenium-maven-plugin:2.3:selenese failed: F irefox refused shutdown while preparing a profile
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:115)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more Caused by: java.lang.RuntimeException: Firefox refused shutdown while preparing a profile
        at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:367)
        at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.populateCustomProfileDirectory(FirefoxChromeLauncher.java:120)
        at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:90)
        at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchHTMLSuite(FirefoxChromeLauncher.java:405)
        at org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchHTMLSuite(FirefoxLauncher.java:110)
        at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:132)
        at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:183)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap.invoke(PojoMetaMethodSite.java:209)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.mojo.selenium.SeleneseMojo.execute(SeleneseMojo.groovy:156)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
        ... 20 more Caused by: org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher$FileLockRemainedException: Lock file still present! C:\Users\ratwood\AppData\Local\ Temp\customProfileDir850445\parent.lock
        at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFileLockToGoAway(FirefoxChromeLauncher.java:318)
        at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:365)
        ... 36 more [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] 

http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

0 Answers
Related