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"/>