我正在運行一些Selenium測試。當我直接從Eclipse啓動它們時,一切正常。但是,當我基於Maven開始他們那裏出現以下異常:未能通過Maven中的Selenium連接到二進制FirefoxBinary
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)
我使用的是Firefox ESR 10.0.10。我也用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>
如果我能有更多的信息來支持你,請讓我知道。
編輯:更新後的pom.xml
EDIT2:什麼最想知道我的,就是我可以從Eclipse運行測試,而不答的問題。他們只是occure,如果我叫「MVN安裝」例如
硒 - 服務器神器具有相關的servlet的API-2.5神器,你應該排除,如果你的項目將在Web應用程序容器內運行 - 硒hq.org。 –
另外爲什麼你需要硒-α依賴? –
我剛試過一些東西。現在我已經添加了排除並刪除了selenium-api依賴項,但問題依然如此 – kirschmichel