Testing with Ant

You can use ant to run Web UI, performance, and compound 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 versions 9.2 and newer of the testing products.

Before you begin

  • Install IBM® Installation Manager.
  • Install the products themselves.
  • Verify that you have a test residing within an Eclipse workspace on the computer where the products are installed.
  • Be sure to add ant to the PATH environment variable.
  • If you are running an older version of the ant plugin, you must shut down the product and IBM Installation Manager before starting test execution. With version 2.0 of the ant plugin, this is no longer necessary.
Note:
  • To run Web UI tests on Linux or Mac OS, you must add an environment variable that points to the installation directory of the product, for example, export TEST_WORKBENCH_HOME=/opt/HCL/HCLProducts. For Windows, this environment variable is already defined.
  • If you installed the product on Windows using the stand-alone installer (not using IBM Installation Manager), you must specify the environment variable that points to the installation directory of the product. For example, export TEST_WORKBENCH_HOME=C:\Program Files\HCL\HCLProducts.

Procedure

  1. Download the ant plugins for the test products from HCL License & Delivery Portal on to the computer where the test product is installed.
  2. Extract the following files from the downloaded plugin:
    • HOT-UI-WebUI-Ant-2.0.jar or HOT-PERF-Ant-2.0.jar
    • ExecuteWebUIFunctionalTest.xml or ExecutePerformanceTest.xml
    • README.txt
  3. Open the ExecuteWebUIFunctionalTest.xml file or ExecutePerformanceTest.xml file and provide parameter values, as shown in the following Web UI example:
    <webui name="test1" workspace="C:\workspace" projectname="TestProject" suite="Tests/test1.testsuite" results="Results/test1_on_anttask" />

    For performance tests, replace <webui> with <pt>.

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

    The following table explains each parameter. Mandatory parameters include name, workspace, project, and suite.

    Parameter Description
    -name Required. Name of the test for the particular test product.
    - workspace Required. 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.
    - 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 results file with the same name is overwritten. The default value, false, means that the results file will not be overwritten.
    - quiet Optional. Turns off any message output from the launcher and returns to the command shell when the run or the attempt is complete.
    - vmargs Java™ virtual machine arguments to pass in.
    - 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 the test workbench.
    - usercomments Optional. Add text within double quotation mark to display it in the User Comments row of the report.
    - users Optional. HCL OneTest™ Performance-only. Overrides the default number of virtual users in the run. For a schedule, the default is the number of users specified in the schedule editor. For a test, the default is one user.
    -imsharedloc Complete path to HCLIMShared location, if it is not at the default location.
  4. Open a command prompt and navigate to the download directory.
  5. Type ant -f ExecuteWebUIFunctionalTest.xml or ant -f ExecutePerformanceTest.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 HOT-UI-WebUI-Ant-2.0 or HOT-PERF-Ant-2.0 from where the ant command is executed.

Feedback