How to resolve taskdef class org.testng.TestNGAntTask cannot be found using the classloader AntClassLoader[] in build.xml file

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to resolve taskdef class org.testng.TestNGAntTask cannot be found using the classloader AntClassLoader[] in build.xml file

Er. Debasish Dutta
While creating testng project and we want to import the build.xml file to the project to run it through ant. after importing the build.xml file we may get the below error

taskdef class org.testng.TestNGAntTask cannot be found using the classloader AntClassLoader[]

So create a separate folder to store all the jars and pass that path to the jars property

 <property name="ws.home" value="${basedir}"/>
<property name="ws.jars" value="D:\TestngJar"/>  here you can see i have stored all the jar files in the folder TestNgJar
    <property name="test.dest" value="${ws.home}/build"/>
    <property name="test.src" value="${ws.home}/src"/>
<property name="ng.result" value="test-output"/>


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to resolve taskdef class org.testng.TestNGAntTask cannot be found using the classloader AntClassLoader[] in build.xml file

vasikarla.raj
On Apr 1, 2015 6:42 PM, "Er. Debasish Dutta" <[hidden email]> wrote:
While creating testng project and we want to import the build.xml file to the project to run it through ant. after importing the build.xml file we may get the below error

taskdef class org.testng.TestNGAntTask cannot be found using the classloader AntClassLoader[]

So create a separate folder to store all the jars and pass that path to the jars property

 <property name="ws.home" value="${basedir}"/>
<property name="ws.jars" value="D:\TestngJar"/>  here you can see i have stored all the jar files in the folder TestNgJar
    <property name="test.dest" value="${ws.home}/build"/>
    <property name="test.src" value="${ws.home}/src"/>
<property name="ng.result" value="test-output"/>


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to resolve taskdef class org.testng.TestNGAntTask cannot be found using the classloader AntClassLoader[] in build.xml file

pdfngreport
In reply to this post by Er. Debasish Dutta
use below block in your build.xml file and point to testng jar location which will resolve that error.
 
<taskdef name="testng" classname="org.testng.TestNGAntTask">
<classpath>
<pathelement location="ext-lib/testng-6.8.5.jar"/>
</classpath>
</taskdef>

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to resolve taskdef class org.testng.TestNGAntTask cannot be found using the classloader AntClassLoader[] in build.xml file

balu selenium
In reply to this post by Er. Debasish Dutta
     <taskdef name="testng" classpath="${testng.classpath}"
               classname="org.testng.TestNGAntTask" />

<property name="testng.classpath" value="c:/testng/testng.jar"/>


Ensure that you have testng.jar file in the path 


thanks


On Thursday, April 2, 2015 at 7:12:09 AM UTC+5:30, Er. Debasish Dutta wrote:
While creating testng project and we want to import the build.xml file to the project to run it through ant. after importing the build.xml file we may get the below error

taskdef class org.testng.TestNGAntTask cannot be found using the classloader AntClassLoader[]

So create a separate folder to store all the jars and pass that path to the jars property

 <property name="ws.home" value="${basedir}"/>
<property name="ws.jars" value="D:\TestngJar"/>  here you can see i have stored all the jar files in the folder TestNgJar
    <property name="test.dest" value="${ws.home}/build"/>
    <property name="test.src" value="${ws.home}/src"/>
<property name="ng.result" value="test-output"/>


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.