使用selenium java的org.openqa.selenium.firefox.NotConnectedException 3.0.1 firefox版本51.0.1。
我正在尝试使用Gecko驱动程序。
这是我的代码
public class Gecko {
String driverPath = "/home/hema/Downloads/Softwares";
WebDriver driver;
@org.junit.Test
public void Test() {
System.setProperty("webdriver.firefox.marionette", driverPath + "/geckodriver.exe");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
driver = new FirefoxDriver(capabilities);
driver.get("http://awsstagewebdriver.doctorinsta.com");
}
@After
public void tearDown(){
driver.close();
}
}
Dependices
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.0.1</version>
</dependency>
</dependencies>
答案 0 :(得分:-1)
请将firefox版本51.0.1降级为46.0.1。