下面使用ant,自动编译并执行一个Java+Selenium+TestNG自动化测试项目。
1.在项目根目录下放入build.xml文件,ant执行的时候是要找build.xml文件去执行
<?xml version="1.0"?>
<project name="TestNGTest" default="test" basedir=".">
<!-- Define <testng> task -->
<taskdef name="testng" classname="org.testng.TestNGAntTask">
<classpath>
<pathelement location="lib/testng.jar"/>
</classpath>
</taskdef>
<property name="testdir" location="build" />
<property name="srcdir" location="src" />
<property name="libdir" location="lib" />
<property name="xmldir" location="src"/>
<property name="full-compile" value="true" />
<path id="classpath.base"/>
<path id="cl