简体   繁体   English

NoClassDefFoundError:org / apache / http / conn / SchemePortResolver-硒

[英]NoClassDefFoundError: org/apache/http/conn/SchemePortResolver - Selenium

I have the below code for selenium 我有下面的硒代码

    public static void main(String[] args) {

    File file = new File("C:\\path\\IEDriverServer.exe");

    System.setProperty("webdriver.ie.driver", file.getAbsolutePath());

    WebDriver driver = new InternetExplorerDriver();

    driver.get("http://hedtq01vr.bcbsma.com:8080/tm/index.jsp?default");

    driver.quit();

}

When i try to run it fails with the below error: 当我尝试运行时,失败并显示以下错误:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/conn/SchemePortResolver

Below are the jars on the build path: 以下是构建路径上的jar:

  • Selenium-java-2.42.2.jar Selenium-java-2.42.2.jar
  • selenium-server-standalone-2.33.0.jar selenium-server-standalone-2.33.0.jar

and IEDriverServer.exe on the C:\\path folder 和IEDriverServer.exe放在C:\\ path文件夹中

Why am i getting this error..The page here doesn't talk anything about the required libraries. 我为什么会收到此错误。.此页面上没有讨论所需的库。

Any suggestions? 有什么建议么?

EDIT: 编辑:

After adding the libraries from the selenium folder, I am getting the below error: 从selenium文件夹添加库后,出现以下错误:

Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE

Here is the complete error link 这是完整的错误链接

The Selenium download comes as a ZIP file ( selenium-java-2.42.2.zip ), which contains not only Selenium-java-2.42.2.jar, but also a sub-directory named 'libs', and which contains a whole raft of JAR libraries that the Selenium jar presumably relies on. Selenium下载以ZIP文件( selenium-java-2.42.2.zip )的形式提供,它不仅包含Selenium-java-2.42.2.jar,还包含一个名为'libs'的子目录,并且包含一个整体Selenium jar可能依赖的大量JAR库。 Among others the libs folder contains httpclient-4.3.2.jar, which is the Apache HTTP component containing the class your current setup cannot find. 其中的libs文件夹包含httpclient-4.3.2.jar,这是Apache HTTP组件,其中包含您当前设置无法找到的类。 Add all the jars in the libs directory on your build path (and then on your classpath at runtime), and you should be sorted. 将所有jar添加到构建路径(然后在运行时的类路径)的libs目录中,然后应进行排序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.NoClassDefFoundError:带有AmazonHttpClient的org / apache / http / conn / SchemePortResolver - java.lang.NoClassDefFoundError: org/apache/http/conn/SchemePortResolver with AmazonHttpClient java.lang.NoClassDefFoundError:org / apache / http / impl / conn / PoolingClientConnectionManager - java.lang.NoClassDefFoundError: org/apache/http/impl/conn/PoolingClientConnectionManager java.lang.NoClassDefFoundError:org / apache / http / conn / HttpClientConnectionManager - java.lang.NoClassDefFoundError: org/apache/http/conn/HttpClientConnectionManager java.lang.NoClassDefFoundError:org / apache / http / conn / scheme / SchemeSocketFactory - java.lang.NoClassDefFoundError: org/apache/http/conn/scheme/SchemeSocketFactory java.lang.NoClassDefFoundError:org / apache / http / nio / conn / NHttpClientConnectionManager - java.lang.NoClassDefFoundError: org/apache/http/nio/conn/NHttpClientConnectionManager Java Firebase错误“ NoClassDefFoundError:org / apache / http / conn / ssl / StrictHostnameVerifier” - Java Firebase error “NoClassDefFoundError: org/apache/http/conn/ssl/StrictHostnameVerifier” java.lang.NoClassDefFoundError:org / apache / http / conn / params / ConnPerRoute - java.lang.NoClassDefFoundError: org/apache/http/conn/params/ConnPerRoute NoClassDefFoundError:Selenium中的org / apache / http / HttpEntity for ChromeDriver吗? - NoClassDefFoundError: org/apache/http/HttpEntity in Selenium for ChromeDriver? org.apache.http.conn.ssl上的java.lang.NoClassDefFoundError org / apache / commons / logging / LogFactory - java.lang.NoClassDefFoundError org/apache/commons/logging/LogFactory at org.apache.http.conn.ssl org.apache.http.client-4.3.6:java.lang.NoClassDefFoundError:org.apache.http.impl.conn.PoolingHttpClientConnectionManager - org.apache.http.client-4.3.6: java.lang.NoClassDefFoundError: org.apache.http.impl.conn.PoolingHttpClientConnectionManager
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM