我試圖運行此代碼:火狐不開與FirefoxDriver硒
@Before
public void setUp() throws Exception {
driver = new FirefoxDriver();
baseUrl = "https://www.google.com.br/";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
,但是它停止(應用程序不退出,僅停止)在FirefoxDriver(),並不會引發任何錯誤。 我使用Firefox 25.0.1(32位),硒IDE 2.5,JAVA JDK 1.7中,Windows 7(64位)與Maven運行:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium</artifactId>
<version>2.0rc2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>selenium-api</artifactId>
<groupId>org.seleniumhq.selenium</groupId>
<type>jar</type>
<version>2.9.0</version>
</dependency>
沒錯!當我添加Maven依賴關係時,他以一種奇怪的方式命令,爲此我得到了舊的。 – ThiagoKrug