无法在 Maven 中使用 Selenium 连接到二进制 FirefoxBinary [英] Failed to connect to binary FirefoxBinary with Selenium in Maven
问题描述
我正在运行一些 Selenium 测试.当我直接从 Eclipse 启动它们时,一切正常.但是当我通过 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:winappFirefoxfirefox.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)
我使用的是 Firefox 10.0.10 ESR.我也用 Selenium 2.25.0 试过了.
I am using Firefox 10.0.10 ESR. I have also tried it with Selenium 2.25.0.
这是我最新版本的 pom.xml:
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.
更新 pom.xml
edit2:最让我惊讶的是,我可以从 Eclipse 运行测试而没有任何问题.他们只是发生了,例如,如果我调用mvn install"
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
推荐答案
我找到了问题所在.
我加载了一些扩展以添加到我用来实例化 FireFoxDriver 的 FirefoxProfile.这些插件位于 Java/main/resources 下.在 Eclipse 中一切正常,但我无法通过 Maven 访问这些插件.将这些文件复制到一个临时文件夹并从那里加载它们后,它甚至可以从 Maven 工作.
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.
感谢您的帮助
这篇关于无法在 Maven 中使用 Selenium 连接到二进制 FirefoxBinary的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!