Browser launching issues with selenium

I'm trying to use the selenium-maven-plugin to automate running Selenium IDE tests. The tests are stored as HTML for the time being, so I'm running them with the "selenese" goal. Below is my pom.xml file.

Running "mvn" works fine to run Firefox on my Mac. However, Chrome (34) fails to launch as does Safari. Chrome does start, but it displays a yellow bar at the top with the following error. I have to click through the SSL warning for the test to run. This prevents automation.

"You are using an unsupported command-line flag: --disable-web-security. Stability and security will suffer."

It also prints some strange stuff in my console.

08:09:26.409 INFO - Launching Google Chrome...
08:09:33.718 INFO - Couldn't proxy to http://qwlflrjuwsed/ because host not found
08:09:33.767 INFO - Couldn't proxy to http://jnjairvl/ because host not found
08:09:33.927 INFO - Couldn't proxy to http://rbqnqivg/ because host not found

Safari has a timeout exception:

[ERROR] Failed to execute goal org.codehaus.mojo:selenium-maven-plugin:2.3:selenese (test) 
on project palogic-web-tests: Execution test of goal org.codehaus.mojo:selenium-maven-
plugin:2.3:selenese failed. SeleniumCommandTimedOutException -> [Help 1]

On Windows, Firefox won't start because of a lock file.

[ERROR] Failed to execute goal org.codehaus.mojo:selenium-maven-plugin:2.3:selenese (test)
on project my-web-tests: Execution test of goal org.codehaus.mojo:selenium-maven-
plugin:2.3:selenese failed: Firefox refused shutdown while preparing a profile: Lock file 
still present! C:ToolscygwintmpcustomProfileDir699886parent.lock -> [Help 1]

My question: Is this "can't launch browsers" issue caused by the selenium-maven-plugin, the selenese goal or Selenium in general? Is it possible to fix it so tests can be automated and browsers easily launched? Or should I look into other solutions, like Geb?

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.company</groupId>
    <artifactId>my-web-tests</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <build>
        <defaultGoal>verify</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>selenium-maven-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <browser>${browser}</browser>
                    <suite>src/test/selenium/testsuite.html</suite>
                    <startURL>https://siteiwanttotest.com/</startURL>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>selenese</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <properties>
        <browser>*firefox</browser>
    </properties>

    <profiles>
        <profile>
            <id>chrome</id>
            <properties>
                <browser>*googlechrome</browser>
            </properties>
        </profile>
        <profile>
            <id>firefox</id>
            <properties>
                <browser>*firefox</browser>
            </properties>
        </profile>
        <profile>
            <id>ie</id>
            <properties>
                <browser>*iexplore</browser>
            </properties>
        </profile>
    </profiles>
</project>
链接地址: http://www.djcxy.com/p/65332.html

上一篇: 硒与Xvfb:firefox.NotConnectedException

下一篇: 浏览器启动硒问题