Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

My Project is using selenium-client-driver 0.9 and selenium based integration test will be executed by maven using maven-selenium-plugin. (There are already many questions in stackoverflow but couldnt find a relavant answer). Selenium test case fails with error Caused by: org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher$FileLockRemainedException: Lock file still present! C:Users agappan.sAppDataLocalTempcustomProfileDir23d2b92949d74270915586b2a3f2073aparent.lock at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFileLockToGoAway(FirefoxChromeLauncher.java:318) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:365) ... 20 more

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
167 views
Welcome To Ask or Share your Answers For Others

1 Answer

I found the answer by myself. Maven selenium plugin just start the hub and not the selenium node (both integrated and standalone). In my case, it is old version of selenium 0.9 and unit testing uses DefaultSelenium so it require a node also which process browser commands by opening browser and console. So i started the hub and node using maven antrun plugin to start the server and hub like

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <version>1.7</version>
    <executions>
    <execution>
        <phase>pre-integration-test</phase> 
        <configuration>
            <target>
                <property name="selenium.server.dir" value="${basedir}" />
                <path id="selenium.classpath">
                    <fileset dir="${selenium.server.dir}">
                        <include name="selenium*.jar" />
                    </fileset>
                </path>     
                <java classname="org.openqa.grid.selenium.GridLauncher"
                      classpathref="selenium.classpath"
                      failonerror="true"
                      fork="false">
                    <arg line="-role hub"/>
                </java>
                <java classname="org.openqa.grid.selenium.GridLauncher"
                      classpathref="selenium.classpath"
                      failonerror="true"
                      fork="false">
                    <arg line="-role node
                               -hub http://localhost:4444/grid/register"/>
                </java>
            </target>
        </configuration>
        <goals>
            <goal>run</goal>
        </goals>
    </execution>
    </executions>
</plugin>

It works now perfectly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...