与Selenium Java 3.0.1 Firefox版本51.0.1的org.openqa.selenium.firefox.NotConnectedException

时间:2017-02-06 05:58:37

标签: java maven selenium firefox selenium-webdriver

  使用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>

1 个答案:

答案 0 :(得分:-1)

请将firefox版本51.0.1降级为46.0.1。