hi all,im getting NoclassDefFoundException while launching firefox browser.could you please help

Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:93)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
at automationframework.Firsttestcase.main(Firsttestcase.java:15)
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.methods.HttpUriRequest
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 8 more

Default Asked on November 12, 2014 in Selenium WebDriver.
Add Comment
  • 2 Answer(s)

    Hi Preeti,

    It could be because of mnay reasons and always try to provide some other information as well, it help us to understand the case better.

    1) The most possible reason of this is that some of the jar is not associated with the project. I request you to associate all the selenium jar files again to your project, make sure you do not miss any. And get the latest one. Most probably you are missing the lib folder from Selenium Library.

    2) It could be because your class path is not valid anymore, try cleaning the project and see other steps on google to regenrate the class path.

    By any chance you are using Maven?

    Lakshay Sharma

    Professor Answered on November 12, 2014.
    Add Comment

    You may try below:
    a) You may upgrade Selenium Webdriver Jars.
    b) Check your firefox version. There may be computability issues. (May be you are using latest Firefox but old webdriver jar files and vice versa)
    c) Create Selenium project again and delete .metadta folder before it.
    d) Ensure the your jar should be include in project.

    Train Answered on November 17, 2014.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.