无法在Maven中使用Selenium连接二进制FirefoxBinary [英] Failed to connect to binary FirefoxBinary with Selenium in Maven

查看:220
本文介绍了无法在Maven中使用Selenium连接二进制FirefoxBinary的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  org.openqa.selenium。 WebDriverException(无法连接到端口7055上的二进制FirefoxBinary(C:\ winapp \ Firefox\ firefox.exe);进程输出如下:
null
构建信息:版本:'2.26.0' ,修订版:'18040',时间:'2012-11-02 09:44:45'
系统信息:os.name:'Windows 7',os.arch:'x86',os.version:' 6.1',java.version:'1.6.0_35'
驱动程序信息:driver.version:FirefoxDriver)

我正在使用Firefox 10.0.10 ESR。我也尝试过Selenium 2.25.0。



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



< pre class =lang-xml prettyprint-override> < 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>

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



编辑:更新的pom.xml



edit2:最让我感到惊讶的是,我可以在没有问题的情况下运行eclipse中的测试。它们刚刚发生,如果我称之为mvn install,例如

解决方案

我找出了问题所在。



我加载了一些扩展来添加到我用来实例化FireFoxDriver的FirefoxProfile中。这些插件位于Java / main / resources下。在Eclipse中一切正常,但我无法通过Maven访问这些插件。将这些文件复制到临时文件夹后,从那里加载它们甚至可以从Maven中运行。



感谢您的帮助


I am running some Selenium-Tests. When I start them directly from Eclipse everything works fine. But when I Start them through Maven there the following Exception occurs:

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)

I am using Firefox 10.0.10 ESR. I have also tried it with Selenium 2.25.0.

Here is my latest version of the 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>

If I can support you with more information, please let me know.

edit: updated pom.xml

edit2: What wonders me most, is that i can run the tests from eclipse without ans problems. they just occure, if i call "mvn install" for example

解决方案

I figured out where the problem was.

I loaded some extensions to add to the FirefoxProfile I use to instantiate the FireFoxDriver. These plugins where located under Java/main/resources. In Eclipse everything worked fine, but I couldn't access these plugins through Maven. After copying these files to a temporary folder, and load them from there it worked even from Maven.

Thanks for your Help

这篇关于无法在Maven中使用Selenium连接二进制FirefoxBinary的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆