Usage Instructions

hatatap can run from the commandline, automated using Ant, or as an interactive web application.

Command Line

To run hatatap scripts from the command line you will need Java 1.4 or newer. First get the file hatatap.jar from the download site. The file does not need to be unpacked and requires no installation. Simply run the file as an executable Java jar as follows:

java -jar hatatap.jar [options] [file]

The command line utility can be invoked without arguments, in which case it will attempt to read a test script from stdin. If a file name is specified, this should be the test script. The utility transforms, compiles and executes the script and produces XML results to stdout, unless an outfile has been specified.

Command Line Options

hatatap v0.8.8 usage:
java com.pingdynasty.hatatap.Hatatap [options] [infile]
option:          description:                            default:
-in <infile>     set input file                          [stdin]
-out <outfile>   set output file                         [stdout]
-i <iterations>  iterations per thread                   [1]
-t <threads>     number of threads                       [1]
-trust           trust all SSL server certificates       [false]
-q               be quiet                                [false]
-v               be verbose                              [false]
-D<name>         set script parameter <name> to true
-D<name>=<value> set script parameter <name> to <value>
-h               help - show this message

Web Application

To run the hatatap web application you will need a Java Servlet engine such as Apache Tomcat. First get the web application archive file hatatap.war from the download site. Deploy the web application in the Servlet Engine, eg by dropping it into the Tomcat webapp directory.

Once deployed, you should be able to navigate to the web application with a browser. The index page has links to the documentation, and to a list of currently deployed test scripts. The scripts can be executed from the web application. Clicking on a script in the list brings up a form that allows you to fill in any test parameters. Here you can also specify the number of threads and iterations for the test run. After executing the script, the web application transforms the test results to an html test report.

To deploy your own test scripts simply add them to the web application script directory. You might have to reload the script list page for the new scripts to appear.

Build Script

The hatatap Ant task can run test scripts one at a time, or process all files in a fileset one after the other.

To run test scripts from an Ant build file you just need to have hatatap.jar in your build classpath. In the following examples we define the classpath lib.path to include the jar.

First you must define the hatatap task:

<path id="lib.path">
  
<pathelement location="lib/hatatap.jar"/>
</path>
<taskdef name="hatatap" classname="com.pingdynasty.hatatap.HatatapTask" classpathref="lib.path"/>

To run a single test simply specify the script and result files:

<hatatap in="test1.xml" out="test1-result.xml"/>

To run a set of scripts, specify them in a nested fileset element. Also specify a result directory and optional result filename suffix - default is .xml. Output files will be created with the same name as the input and same relative path, but with the specified or default suffix.

<hatatap destdir="results/" suffix="-result.xml">
  
<fileset dir="tests/">
    
<include name="**/*.xml"/>
  
</fileset>
</hatatap>

Script parameters can be specified with nested param elements:

<hatatap in="test.xml" out="result.xml">
  
<param name="url" value="http://www.pingdynasty.com"/>
</hatatap>

Other options include setting the log level (with attribute logLevel = debug, info, warning or error) and classpath (using reference or nested classpath elements).

Generating Scripts Using Apache JMeter

Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance.. You can also use it to record the communication between browser and server. The recording forms a test script, that can be used to repeat the exact same sequence of actions as taken when using a normal browser (of your choice). hatatap is able to transform JMeter recordings into hatatap test script format.

To create a JMeter test script, do the following:

Once you have saved a JMeter project file, for example foobar.jmx, you can transform it into a hatatap test script as follows:

java -jar hatatap.jar foobar.jmx -out script.xml

This will create a new hatatap test script, called script.xml. hatatap automatically recognises the filename extension .jmx. If no outfile parameter is provided, the resulting test script will be sent to stdout.

JMeter also have a step by step instruction on recording tests available in PDF format, which you may find useful.