Using the webtester as ANT task
1. prepare ant
All the jar files in the lib subdirectory and the webtester.jar must be in the classpath for ANT. The easiest way is to copy them all to ANT_HOME/lib.
2. include the taskdef
In order now to use the new task you need to put the following line at the beginning of your build.xml:
<taskdef name="webtest" classname="org.jzonic.webtester.tasks.WebTesterTask"/>
3. the parameter
The new task supports three different parameters.
- file: the name of the file containing the test
- dir: the directory that contains a set of testscipts
- outputFile: the result will be written to this file. If not defined then it will write to the console.
4. run tests
<?xml version="1.0"?>
<project name="Demo" default="main" basedir=".">
<taskdef name="webtest" classname="org.jzonic.webtester.tasks.WebTesterTask"/>
<target name="main">
<webtest fileName="testcases/my_form.test" outputFile="test_result.txt"/>
</target>
</project>