aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes taskdef class org.testng.TestNGAntTask can't be found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "taskdef class org.testng.TestNGAntTask can Watch "taskdef class org.testng.TestNGAntTask can New topic
Author

taskdef class org.testng.TestNGAntTask can't be found

Shashank Gollapudi
Ranch Hand

Joined: Jan 19, 2012
Posts: 33
HI
I am trying to run an automation suite integrating selenium web driver with testng, but when i try writing an ant script i keep getting this error, which basically has to do with the classpath, and i am sure i have the specified class in testng-6.8.jar which was included in my classpath

taskdef class org.testng.TESTNGAntTask cannot be found using the classloader AntClassLoader[C:\XXXXXX\lib\testng-6.8.jar]

and here is the snippet of this in my build.xml file
i tried various ways , but unfortunately none worked.

1)





2)





Any pointers on this is truly appreciated.

Thanks & Regards,
Shashank
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

Have you tried running ant with the -v or -d options, that should give you some extra output which might help you solve this.


JBoss In Action
Shashank Gollapudi
Ranch Hand

Joined: Jan 19, 2012
Posts: 33
Peter Johnson wrote:Have you tried running ant with the -v or -d options, that should give you some extra output which might help you solve this.



Thanks for the reply Peter, i haven't run it with -v before and now ran it and found the problem. The problem was actually me giving the name of the class wrong. Instead of TestNGAntTask i gave it as TESTNGAntTask (used unnecessary uppercase value).

Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: taskdef class org.testng.TestNGAntTask can't be found