小编kir*_*hel的帖子

无法在Maven中使用Selenium连接二进制FirefoxBinary

我正在运行一些Selenium-Tests.当我直接从Eclipse启动它们时,一切正常.但是当我通过Maven启动它们时会发生以下异常:

org.openqa.selenium.WebDriverException(Failed to connect to binary FirefoxBinary(C:\winapp\Firefox\firefox.exe) on port 7055; process output follows: 
null
Build info: version: '2.26.0', revision: '18040', time: '2012-11-02 09:44:45'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_35'
Driver info: driver.version: FirefoxDriver)
Run Code Online (Sandbox Code Playgroud)

我使用的是Firefox 10.0.10 ESR.我也尝试过Selenium 2.25.0.

这是我最新版本的pom.xml:

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.26.0</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>2.26.0</version>
        <exclusions>
            <exclusion>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.4.1</version>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>org.jdom</groupId>
        <artifactId>jdom2</artifactId>
        <version>2.0.3</version>
    </dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)

如果我能为您提供更多信息,请告诉我们.

编辑:更新的pom.xml

edit2:最让我感到奇怪的是,我可以在没有问题的情况下运行eclipse中的测试.它们只是发生,如果我称之为"mvn …

java junit selenium maven selenium-webdriver

33
推荐指数
2
解决办法
6万
查看次数

标签 统计

java ×1

junit ×1

maven ×1

selenium ×1

selenium-webdriver ×1