Run UFT One tests in parallel

Use the ParallelRunner tool to run multiple UFT One tests in parallel. This reduces the run time of your test suite and increases delivery speed.

Overview

The ParallelRunner is a tool provided for you to achieve parallel testing in UFT One. You can run multiple types of tests at the same time across various browser or device combinations.

Before you start testing in parallel, configure your parallel test run in one of the following ways:

Then you can start parallel testing in one of the following ways:

Back to top

Supported test types and environments

You can run the following types of tests in parallel:

  • GUI Web test

    Parallel web testing is supported on specific browsers, for controls supported by the Web Add-in. Supported browsers include Chrome, Chrome_Headless, ChromiumEdge, Edge, Firefox, Firefox64, IE, IE64, and Safari.

  • GUI Mobile test

    Parallel testing on mobile devices is supported when using UFT Mobile and not when testing on local devices.

  • API test

    The ParallelRunner supports API tests, API tests called by GUI tests, and vice versa.

  • Java test (tech preview)

    Parallel testing on java applications is supported when using multiple Java environment (such as Oracle JRE, openJDK, ZuluOpenJDK, and IBM JRE) and toolkits (such as JavaFX, SWT, Swing, and AWT), for controls supported by the Java Add-in.

Back to top

Before starting parallel testing

Before you start parallel testing, do the following:

  1. Ensure that your licenses support your use cases.

    The ParallelRunner supports running up to four tests in parallel. Additionally, desktop web testing in parallel requires a concurrent license server. Each web test run consumes a single concurrent license.

  2. Make sure that the firewall on your UFT One computer does not block the port used by the ParallelRunner (50051 by default).

  3. (Optional for API tests) Modify your test scripts to run test steps in isolated mode.

  4. If you are testing mobile web browsers, ensure that the correct browser is selected in the Record and Run Settings, on the Mobile tab.

    For more details, see Define settings to test mobile apps.

  5. For web testing, if you specify web browsers, these browsers are launched before running the test. This overrides the settings defined in the Record and Run Settings, and any browser parameterization configured in the test.

    This means:

    • For this run, the Record & Run settings are changed to launch the browsers specified.

      If the Record and Run settings were set to Record and Run on any open browser, this option is deselected for the current run.

      If the Record and Run settings were set to launch specific browsers, these browsers are not launched.

    • If your test includes WebUtil.LaunchBrowser steps, these will launch additional browser windows. Make sure the test correctly differentiates between the browsers.

  6. If you are testing Java applications, in the Record and Run Settings, on the Java tab, specify the application information to open these applications before the run session starts.

    Note: The SystemUtil.Run step is not supported to open Java applications for parallel execution.

Back to top

Run steps in isolated mode

Relevant for GUI Web and Mobile tests

When running multiple tests in parallel that have related steps that interact with the same objects, the steps may interfere with each other and cause errors in your parallel test run. In addition, global settings configured specifically for a test may affect the execution of other tests.

To prevent errors and ensure smooth test run, configure the steps and settings to run in isolated mode by surrounding them with the following utility steps:

  • ParallelUtil.StartIsolatedExecution
  • ParallelUtil.StopIsolatedExecution

Example 1: Configure test steps to run in isolated mode:

ParallelUtil.StartIsolatedExecution

Browser("Advantage Shopping").Page("Google").WebEdit("Search").Click

Dim mySendKeys

set mySendKeys = CreateObject("WScript.shell")

mySendKeys.SendKeys("Values")

ParallelUtil.StopIsolatedExecution

Example 2: Configure OCR settings to run in isolated mode:

ParallelUtil.StartIsolatedExecution
TextUtil.SetABBYYParameters("removeGarbage", True)
TextUtil.ResetABBYYParameters
ParallelUtil.StopIsolatedExecution

Example 3: Configure other global settings to run in isolated mode:

ParallelUtil.StartIsolatedExecution
Setting(SnapshotReportMode) = 1
ParallelUtil.StopIsolatedExecution

For more details, see the ParallelUtil and Setting object reference in the UFT One Object Model Reference for GUI Testing.

Back to top

Modify the ParallelRunner port

ParallelRunner uses the port configured in the parallel.ini file located in the <UFT One installation folder>/bin directory. The default port is 50051.

If the port configured there is already in use elsewhere, modify it by doing one of the following:

  • Open the <UFT One installation folder>/bin/parallel.ini file for editing, and modify the port number configured.

  • If you have permission issues editing this file, create a new file named parallel.custom.ini in the %ProgramData%\UFT One directory.

    Add the following code:

    [Mediator]
    Port=<port number>

    The parallel.custom.ini file overrides any configuration in the parallel.ini file.

Back to top

See also: