Scenario Runner

PureTest Logo
PureTest 3.5
November 2007
http://www.minq.se
support@minq.se

Documentation Index

Scenario Runner

Typically a product life cycle includes several releases. This could be bug releases and releases where new functions has been added. Every release includes time consuming and costly re-test activities. The concept of automatic regression test aims to reduce the cost and time for these tests.

PureTest include a command line utility, Scenario Runner, supporting this by executing scenarios in a PureLoad Configuration (PLC) file. Also included is a a Jakarta Ant task to support integration of regression tests into a build process.

Usage

The Scenario Runner is started from the command prompt as follows:

% <install-home>/bin/puretest runner <scenario file>

where install-home is the directory where PureTest is installed.

There are a number of options available to control the output from the runner. Starting the runner without arguments shows a help text with the available options:

Usage:
runner [-v OFF | ERROR | INFO | DEBUG] (runner verbose level)
       [-log OFF | ERROR | INFO | DEBUG] (task log level)
       [-se] (stop on error)
       <scenario file to run>

Default is '-v INFO -log ERROR'.

Options:

-v
controls the verbose level of the runner itself. Default is INFO.
-log
controls the log level used for all log output from the tasks being executed. Default is ERROR.
-se
a flag to control the behavior when an error is encountered. If set, the runner will stop executing if any task fails. The default behavior is to continue execution in case of error.

The default verbose and log levels (-v INFO and -log ERROR) will show execution time for each scenario and detailed information on errors if such occurs. Set both -v and -log to OFF to run in completely silent mode.

When the runner exits, it will return an exit status code. Exit status 0 means success, 1 means one or more execution errors and 2 means invalid input or failure to load scenario file.

Note: The runner will skip the scenarios in the file that have any kind of distribution associated with them (defined by using PureLoad).

Ant Task

The Jakarta Project refers to the build tool Ant as the "make without make's wrinkles". Ant is becoming the de facto standard in the Java and open-source world.

The following assumes general knowledge about Ant.

The Scenario Runner Ant task is a simple ant task for invoking the scenario-runner provided with PureTest to execute a scenario.

Note: This task depends on external libraries not included in the Ant distribution. The jar files provided with PureTest in the lib directory are required.

Ant Task Attributes

Attribute Description Required
file Scenario-file (PLC-file) to be used
Yes
verbose OFF, ERROR, INFO or DEBUG No; default is INFO
tasklog OFF, ERROR, INFO or DEBUG No; default is ERROR
stoponerror Stop execution of tasks in scenario(s) on errors No; default is false
failonerror Stop the buildprocess if execution of scenario fails No; default is false
classpath Classpath to use to run scenario runner No
classpathref Classpath to use, given as reference to a path defined elsewhere No

The classpath must the jar files provided with PureTest.

Defining the build file

The best way to set the classpath is to use a path reference as follows:

  <!-- Define PureLoad/PureTest installation directory -->
  <property name="pureload.home" location="/home/janne/puretest-3.5"/>

  <!-- Define class path based on the above -->
  <path id="pureload.path">
    <fileset dir="${pureload.home}/lib">
      <include name="**/*.jar"/>
    </fileset>
  </path>

Where the pureload.home property should be set to where your installation is located.

This makes it easy to reference this class path in the definion of the task as well as in the task:

  <!-- Task definition -->
  <taskdef name="scenario-runner" classpathref="pureload.path"
           classname="com.pureload.tools.ant.ScenarioRunnerAntTask">
  </taskdef>
 
  <!-- test target -->
  <target name="test">
    <scenario-runner classpathref="pureload.path"
                     file="minq.plc"
                     verbose="DEBUG" tasklog="DEBUG"/>
  </target>



Copyright © 2007 Minq Software AB. All rights reserved.