Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8035247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:15:25+00:00 2026-06-05T02:15:25+00:00

I am struggling with Ant these days, trying to make it driver my WebDriver

  • 0

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 )

<property name="src" value="./src" />
<property name="lib" value="d:/apache-ant-1.8.4/lib/" />
<property name="bin" value="./bin/" />
<property name="report" value="./report" />
<path id="test.classpath">
    <pathelement location="${bin}" />
    <fileset dir="${lib}">
        <include name="**/*.jar" />
    </fileset>
</path>

<target name="init">
    <delete dir="${bin}" />
    <mkdir dir="${bin}" />
</target>

<target name="compile" depends="init">
    <javac source="1.6" srcdir="${src}" fork="true" destdir="${bin}" >
        <classpath>
            <pathelement path="${bin}">
            </pathelement>
            <fileset dir="${lib}">
                <include name="**/*.jar" />
            </fileset>
        </classpath>
    </javac>
</target>

<target name="exec" depends="compile">
    <delete dir="${report}" />
    <mkdir dir="${report}" />
        <mkdir dir="${report}/xml" />
    <junit printsummary="yes" haltonfailure="no">
        <classpath>
            <pathelement location="${bin}" />
            <fileset dir="${lib}">
                <include name="**/*.jar" />
            </fileset>
        </classpath>

        <test name="com.yourcompany.selenium.ccloop.tb6NoInterested" haltonfailure="no" todir="${report}/xml" outfile="TEST-result">
            <formatter type="xml" />
        </test>
    </junit>
    <junitreport todir="${report}">
        <fileset dir="${report}/xml">
            <include name="TEST*.xml" />
        </fileset>
        <report format="frames" todir="${report}/html" />
    </junitreport>
</target>

Now, when I run ant everything gets build fine, but the test does not run and I am getting the NoClassDefFoundError.

org/apache/http/HttpHost

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

java.lang.NullPointerException at
com.yourcompany.selenium.ccloop.tb6NoInterested.tearDown(Unknown
Source)

Package name is com.yourcompany.selenium.ccloop
Test name is tb6NoInterested

I have all the jars in ant lib folder ( the hamcrest, junit, selenium ones )

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:15:27+00:00Added an answer on June 5, 2026 at 2:15 am

    It seems that httpcore from apache is not in the classpath.

    org/apache/http/HttpHost is a class in that library.

    I usually use findjar to find which jars contain classes, when I get a surprising NoClassDefFoundError.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to revise my build process to use ant with apache ivy
I've be struggling for a while trying to make it work. Basically I have
struggling a bit to get the following to work : I'm trying to merge
Really struggling to figure this out. Just trying to take in data from php
Im struggling here for a lot, Im trying to upload an image from iphone
Lost in the multitude of Java API's and XML configuration. I am trying to
Struggling with the following SQL problem. Assume a three dimensional table with entries (h,t,q)
Struggling a bit today. I have the following method that returns a list of
Struggling to get my head around these MD Arrays so hoping someone can help.
Struggling with onchange for JQuery Datetime plugin: http://plugins.jquery.com/project/datetime I am using the following code.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.