Win10支持selenium3.0.1?

时间:2016-12-14 12:14:31

标签: selenium-grid

selenium-server-standalone-3.0.1.jar是否与Windows 10 OS兼容?

我能够运行一个简单的java程序,在启动Firefox浏览器时遇到以下错误。尝试使用TestNG,但面临同样的问题

代码:

package com.riversad.violet;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class DemoTests {
    public void sampleTest1(){
        System.setProperty("webdriver.gecko.driver", "D:\\Auto Violet Work Space\\VioletAutomation\\lib\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();
        driver.get("http://www.gmail.com");
    }
    public void tests() {
        System.out.println("hellow world");
    }
    public static void main(String[] args) {
        DemoTests dt=new DemoTests();
        dt.sampleTest1();
        dt.tests();
    }
}

错误:

  

线程“main”中的异常java.lang.NoSuchFieldError:INSTANCE         在org.apache.http.conn.ssl.SSLConnectionSocketFactory。(SSLConnectionSocketFactory.java:144)         在org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:71)         在org.openqa.selenium.remote.internal.HttpClientFactory。(HttpClientFactory.java:57)         在org.openqa.selenium.remote.internal.HttpClientFactory。(HttpClientFactory.java:60)         在org.openqa.selenium.remote.internal.ApacheHttpClient $ Factory.getDefaultHttpClientFactory(ApacheHttpClient.java:250)         在org.openqa.selenium.remote.internal.ApacheHttpClient $ Factory。(ApacheHttpClient.java:227)         在org.openqa.selenium.remote.HttpCommandExecutor.getDefaultClientFactory(HttpCommandExecutor.java:92)         在org.openqa.selenium.remote.HttpCommandExecutor。(HttpCommandExecutor.java:71)         在org.openqa.selenium.remote.HttpCommandExecutor。(HttpCommandExecutor.java:59)         在org.openqa.selenium.remote.service.DriverCommandExecutor。(DriverCommandExecutor.java:49)         在org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:277)         在org.openqa.selenium.firefox.FirefoxDriver。(FirefoxDriver.java:247)         在org.openqa.selenium.firefox.FirefoxDriver。(FirefoxDriver.java:242)         在org.openqa.selenium.firefox.FirefoxDriver。(FirefoxDriver.java:238)         在org.openqa.selenium.firefox.FirefoxDriver。(FirefoxDriver.java:127)         在com.riversad.violet.DemoTests.sampleTest1(DemoTests.java:25)         在com.riversad.violet.DemoTests.main(DemoTests.java:41)

1 个答案:

答案 0 :(得分:0)

在我的Windows 10计算机上使用带有selenium 3.0.1的webdriver时,我遇到了类似的问题。

从[Selenium Downlaod] [1]下载旧版本的selenium webdriver。 从下载的zip文件中搜索 jcommander-1.48.jar ,并将此jar添加到当前项目中。

这应该修复 NoSuchFieldError ,你的项目应该成功编译。