Note that there are some explanatory texts on larger screens.

plurals
  1. POAnt jUnit WebDriver - NoClassDefFoundError
    primarykey
    data
    text
    <p>I am struggling with Ant these days, trying to make it driver my WebDriver tests. So far I got to the following build.xml ( blatantly copied from somewhere )</p> <p> </p> <pre><code>&lt;property name="src" value="./src" /&gt; &lt;property name="lib" value="d:/apache-ant-1.8.4/lib/" /&gt; &lt;property name="bin" value="./bin/" /&gt; &lt;property name="report" value="./report" /&gt; &lt;path id="test.classpath"&gt; &lt;pathelement location="${bin}" /&gt; &lt;fileset dir="${lib}"&gt; &lt;include name="**/*.jar" /&gt; &lt;/fileset&gt; &lt;/path&gt; &lt;target name="init"&gt; &lt;delete dir="${bin}" /&gt; &lt;mkdir dir="${bin}" /&gt; &lt;/target&gt; &lt;target name="compile" depends="init"&gt; &lt;javac source="1.6" srcdir="${src}" fork="true" destdir="${bin}" &gt; &lt;classpath&gt; &lt;pathelement path="${bin}"&gt; &lt;/pathelement&gt; &lt;fileset dir="${lib}"&gt; &lt;include name="**/*.jar" /&gt; &lt;/fileset&gt; &lt;/classpath&gt; &lt;/javac&gt; &lt;/target&gt; &lt;target name="exec" depends="compile"&gt; &lt;delete dir="${report}" /&gt; &lt;mkdir dir="${report}" /&gt; &lt;mkdir dir="${report}/xml" /&gt; &lt;junit printsummary="yes" haltonfailure="no"&gt; &lt;classpath&gt; &lt;pathelement location="${bin}" /&gt; &lt;fileset dir="${lib}"&gt; &lt;include name="**/*.jar" /&gt; &lt;/fileset&gt; &lt;/classpath&gt; &lt;test name="com.yourcompany.selenium.ccloop.tb6NoInterested" haltonfailure="no" todir="${report}/xml" outfile="TEST-result"&gt; &lt;formatter type="xml" /&gt; &lt;/test&gt; &lt;/junit&gt; &lt;junitreport todir="${report}"&gt; &lt;fileset dir="${report}/xml"&gt; &lt;include name="TEST*.xml" /&gt; &lt;/fileset&gt; &lt;report format="frames" todir="${report}/html" /&gt; &lt;/junitreport&gt; &lt;/target&gt; </code></pre> <p></p> <p>Now, when I run ant everything gets build fine, but the test does not run and I am getting the NoClassDefFoundError.</p> <blockquote> <p>org/apache/http/HttpHost</p> <p>java.lang.NoClassDefFoundError: org/apache/http/HttpHost at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:144) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:86) at com.yourcompany.selenium.ccloop.tb6NoInterested.setUp(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.apache.http.HttpHost at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) N/A</p> <p>java.lang.NullPointerException at com.yourcompany.selenium.ccloop.tb6NoInterested.tearDown(Unknown Source)</p> </blockquote> <p>Package name is com.yourcompany.selenium.ccloop Test name is tb6NoInterested</p> <p>I have all the jars in ant lib folder ( the hamcrest, junit, selenium ones )</p> <p>What am I doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload