Create and run a test batch

Relevant for: GUI tests and components and API testing

Test Batch Runner enables you to run tests in a collective, successive test run.

Tests are run individually but sequentially in a single session.

Open the Test Batch Runner

You do not need to have OpenText Functional Testing open to use the Test Batch Runner.

Start the Test Batch Runner from the Start menu, or from the following path: <Installdir/bin/UFTBatchRunner.exe.

Tip: When open, if you are using a concurrent license, select Test > Close UFT after Test Run to close OpenText Functional Testing and release the license when the test run is complete.

Back to top

Add batches or tests

Use Test Batch Runner to create a list of tests that can be used to run the same batch of tests again another time. Save the list as a batch .mtb file.

Tip: You can include or exclude a test in your batch list from running during a particular batch run without affecting the other tests in the batch.

Add a test batch file (.mtb)
  1. Select File > Add or click the Add button .
  2. Navigate to the folder in which the batch file is saved.
Add individual tests
  1. Select Tests > Add or click the Add button .
  2. In the Browse For Folder dialog box, select the folder in which your tests are located.

All the tests from the selected folder are added to the Tests pane in the main Test Batch Runner window.

Alternatively, drag tests from your file system into the Test Batch Runner. You can drag specific tests, or a test folder. If you drag a test folder, all the tests in the folder are added to the batch.

Note: When adding tests through the Tests > Add menu command, you must select all the tests from the target folder.

Back to top

Select the tests to run

Select the checkboxes of the tests you want to run.

  • The tests run according to the order in which you selected them.

  • The Order column displays the order in which you selected the tests, which is the order in which the tests run.

  • (Optional) Click the Random button to indicate the selected tests should run in a random order.

  • Drag and drop individual tests in the Test Batch Runner window to change the order in which the tests are displayed.

Back to top

Run the test batch

Click the Run button to run the test batch.

The Output pane allows you view the results of the test run in run time, including:

  • The test's path in the file system
  • The progress of the test
  • Any errors that occur during the run

Back to top

Run the test batch using a command line

Run the test batch using a command line to include tests in a build run in a continuous integration system.

In the Command Line window, enter the following syntax:

Copy code
UFTBatchRunnerCMD.exe -source "test path" -result "result path"

The following table describes the command-line parameters:

-source

Specifies the path to a test batch file (.mtb) or folder containing the tests to be run. For example:

UFTBatchRunnerCMD.exe -source "C:\users\MySample.mtb"
UFTBatchRunnerCMD.exe -source "C:\users\APITest1"
-result

Specifies a location to save the test batch run results.

-overwriteReport

Specifies how to store reports when multiple tests run in succession:

Y. Each test’s run results overwrite the previous result and in the end, only the run results of the last test in the batch are available. (This is the default behavior)

N. Each test's run results are saved in a separate subfolder under the result location you specified. The subfolders are numbered according to the order in which the tests ran.

Pass test parameters in your command

To add test parameters to your command, use the following syntax:

UFTBatchRunnerCMD.exe -source "C:\users\GUITest1" -parameter "Parameter1=UFT;Parameter2=Test"

Note:  

  • Passing test parameters is supported for running single tests only, and not for all tests in a folder.

  • You can include a semi-colon (;) in a parameter value, using a backslash (\) as an escape character, as shown in the following example for the Connection parameter:

    UFTBatchRunnerCMD.exe -source "C:\GUITest1" -parameter "Parameter1=UFT;Parameter2=Test;Connection='Key1=value1\;key2=value2\;'"

Run the test batch using a Runtime Engine license

To run a test batch using a Runtime Engine license only, with OpenText Functional Testing on hidden mode, add the -visible N parameter to your command line.

For example:

UFTBatchRunnerCMD.exe -visible N -source "C:\users\MySample.mtb"

Stop running the test batch using a command line

To stop running a test batch, use the following syntax:

UFTBatchRunnerCMD.exe -stop Y

Back to top

View the test batch run results

Following the test batch run, the results are saved to a run results file.

This file includes details about whether the test passed or failed and errors in running the test.

  • In the Tests pane, click the results link for a specific test in the Report column.

  • If your test batch is run using the command line, navigate to the results folder indicated by the command output to view the run results.

Back to top

See also: