Running tests by using Ant

You can use Ant to run compound tests and performance tests from the command-line interface.

Before you begin

You must have completed the following tasks:
  • Installed Installation Manager.

  • Installed Rational® Performance Tester.

  • Verified that you have test assets residing within Rational® Performance Tester.

  • Downloaded the Rational® Performance Tester from the IBM WebSphere, Liberty & DevOps Community portal on to the computer where you install the product.

    For more information about specific versions of plugin, see Integration plugin compatibility matrix.

  • Added Ant to the PATH environment variable.

About this task

To run performance tests on Mac OS, you must add an environment variable that points to the installation directory of Rational® Performance Tester.

For example, export TEST_WORKBENCH_HOME=/opt/IBM/SDP.

Note: For Windows and Linux®, the environment variable is set when you install the product.

Procedure

  1. Extract the following files from the downloaded ant plugin:
    • RPT-Ant-x.0.jar

      Where, x is the version number of the Ant plugin.

    • ExecutePerformanceTest.xml

    • README.txt

  2. Open the ExecutePerformanceTest.xml file and provide required parameter values.
    For example,

    <pt name="test1" workspace="C:\workspace" projectname="TestProject" suite="Tests/test1.testsuite" results="Results/test1_on_anttask" />

    Note: You can add an additional <pt> task and provide the details for each test to run multiple tests simultaneously.

    The following table explains each field in detail.

    Field Description
    name Required. The name of the test for the particular test product.
    workspace Required. The complete path to the Eclipse workspace.
    projectname Required. The path, including the file name of the project relative to the workspace.
    suite Required. The path, including the file name of the test to run relative to the project. A test can be a performance schedule or a compound test.
    varfile Optional. The complete path to the XML file that contains the variable name and value pairs.
    configfile Optional. The complete path to a file that contains the parameters for a test or schedule run.
    results Optional. The name of the results file. The default result file is the test or schedule name with a time stamp appended.
    overwrite Optional. Determines whether a result file with the same name is overwritten. The default value is false, which means the result file cannot be overwritten and a new result file is created.
    vmargs Optional. to pass Java virtual machine arguments.
    swapdatasets Optional. For a test or schedule, the default value is the dataset specified in the test editor or schedule editor.

    You must use the swapdatasets option to replace dataset values during a test or schedule run. You must ensure that both original and new datasets are in the same workspace and have the same column names. You must also include the path to the dataset.

    For example: /project_name/ds_path/ds_filename.csv:/project_name/ds_path/new_ds_filename.csv. You can swap multiple datasets that are saved in a different project by adding multiple paths to the dataset separated by a semicolon (;).

    overridermlabels Optional. For a schedule (Rate schedule or VU schedule), use overridermlabels to perform any of the following actions:
    • To enable the Resource Monitoring from Service option for a performance schedule if the Resource Monitoring from Service option is not enabled from the schedule editor in Rational® Performance Tester.

    • To ignore Resource Monitoring sources that were set in the performance schedule and to change for a label matching mode.

    • To replace an existing set of Resource Monitoring labels that were set in the performance schedule and run the schedule with a new set of Resource Monitoring labels.

    exportstats Optional. The complete path to a directory that can be used to store exported statistical report data.
    exportstatreportlist Optional. A comma-separated list of absolute paths to custom report format files (.view files) to use when exporting statistical report data with the exportstats option.
    exportstatshtml Optional. The complete path to a directory that can be used to export web analytic results. The results are exported in the specified directory. Analyze the results on a web browser without using Rational® Performance Tester.
    usercomments Optional. Add text within the double quotation mark () to display it in the User Comments row of the report.
    users Optional. For a schedule, the default value is the number of users specified in the schedule editor. For a test, the default value is one user. Overrides the default number of users, if required.
    imsharedloc Optional. The complete path to IBMIMShared location, if it is not at the default location.
    labels

    Optional. Adds labels to test results when the test run is complete. You can add multiple labels to a test result separated by a comma.

    For example, labels =label1, label2

    When you run test assets then the same labels are displayed on the Performance Report in Rational® Performance Tester.

    If you have set Publish result after execution as Always or Prompt in the Rational® Performance Tester preferences (Window > Preferences > Test > Rational Test Automation Server) and use labels option, then the Results page of Rational® Test Automation Server displays the same label for the specific test asset.

  3. Open a command prompt and navigate to the directory where you downloaded the Ant plugin.
  4. Enter ant -f ExecutePerformanceTest.xml to run the test.

Results

You have run the test by using the Ant plugin.

What to do next

You can view that the Ant execution output is logged into the logfile.txt file, and a test log is created in a temp directory called RPT-Ant-x.0.

If you have configured the URL of Rational Test Automation Server in preferences (Window > Preferences > Test > Rational Test Automation Server) of Rational® Performance Tester and set Publish result after execution as Always, then the Reports information section on the Log file displays the names of the report along with its corresponding URLs.