TestNg using Ant
When I run Test NG test开发者_开发问答 using testng.xml, it runs fine but if i run testng.xml using ant (Build.xml), it gives an error Cannot fine class in classpath
Testng.xml:-
?xml version="1.0" encoding="UTF-8"?>
Build.xml:-
<xmlfileset dir="." includes="testng.xml"/>
<xmlfileset dir="." includes="testng.xml">
Certainly the error is in this line.Its looking for compiled classes in the base directory(dir=".").point dir to bin folder where the compiled classes would be usually or wherever you have kept the compile classes.here an example:
<xmlfileset dir="${basedir}/bin" includes="testng.xml">
精彩评论