Testing with Ant

You can use ant to run functional tests from the command line. Starting with version 2.0 of the ant plugin, you can run multiple tests simultaneously. Version 2.0 of the ant plugin is supported in Rational® Functional Tester 9.2 and newer.

Before you begin

  • Install Installation Manager.
  • Install Rational® Functional Tester.
  • Verify that you have a functional test residing within an Eclipse workspace on the computer where Rational® Functional Tester is installed.
  • Be sure ant is installed and added to the PATH environment variable.
  • Download the ant plugin for Rational® Functional Tester from Rational® Functional Tester Plugins and install Ant on to the computer where Rational® Functional Tester is installed.

Procedure

  1. Extract the following files from the downloaded plugin:
    • RFT-Ant-2.0.jar
    • ExecuteFunctionalTest.xml
    • README.txt
  2. Open the ExecuteFunctionalTest.xml file and provide parameter values, as shown in the following example:
    <ft name="test1" projectDir="C:\workspace\Project" scriptName="Script1"/>

    To run multiple tests, add additional <ft> tasks and provide details for each test.

    The following table explains each parameter.
    Parameter Description
    -name Required. Name of the test.
    - projectDir Required. The fully qualified path to the Rational® Functional Tester project directory. Use '\\' or '/' as the file separator.
    - scriptName Required. The name of the script to be run.
    - logFormat Optional. The format of the logs that are created when the script is run. The options are: Default, XML, HTML, text, and TPTP.
    - iterationCount Optional. The number of dataset iterations to be run.
    - userArgs Optional. Additional playback arguments, if any.
  3. Open a command prompt as an administrator or a root user. This applies even when you have logged into a test machine with administrator privileges.
  4. Navigate to the download directory and verify that it includes the ExecuteFunctionalTest.xml file.
  5. Type ant -f ExecuteFunctionalTest.xml to start test execution.

    When ant execution completes, a test result is displayed. Ant execution output is logged into the logfile.txt file, and a test log is created in a temp directory under RFT-Ant-2.0 from where the ant command is executed.