Creating Distributed Tests - Basic Steps

Applies to TestComplete 14.0, last modified on January 23, 2019
Information in this topic applies to desktop and web applications.

You can use TestComplete to create distributed tests consisting of several parts that will be run on remote computers.

Creation of distributed tests includes the following steps:

1. Preparing Remote Computers and Slave Projects

Before creating a distributed test make sure that all remote computers meet the following requirement:

Distributed Testing - Requirements

All slave projects must include the NetworkSuite project item.

Also, remote computers must have access to the slave projects. For this purpose, before the test starts, the slave projects must reside on the appropriate remote computers. If the slave projects were created on the master computer, you can configure your master project to copy them to the remote computers automatically. See Copying Slave Projects to Remote Computers.

2. Creating a Master Project

Create a new master project or use an existing one. For information on creating projects, see Creating Projects and Project Suites.

The master project must contain a NetworkSuite project item that manages project runs on remote computers.

Set NetworkSuite’s Deploy Mode and specify the Credentials property.

The Deploy mode specifies whether the slave projects stored on the master computer are to be copied to remote computers automatically when the test starts. The Credentials property is used to specify default account information required for opening user sessions on remote computers. For more information on NetworkSuite project properties, see Network Suite Editor - Properties Page.

Specify the NetworkSuite variables. These variables are shared between all projects and can be used for data exchange. For more information on NetworkSuite variables, see Network Suite Variables.

3. Specifying Hosts

The NetworkSuite project item holds a Hosts collection that contains a list of computers on which the master project runs the slave projects. Add Host items to the collection and specify their properties. For more information on this, see Working With Hosts.

For each host item specify either the network name or IP address of a remote computer.

Specify the account information for each host. This account information is required for opening user sessions on remote computers.

If you develop slave projects on the master computer, you can copy them to the hosts directly from TestComplete. For more information, see Copying Slave Projects to Remote Computers.

4. Specifying Jobs

The NetworkSuite project item holds a Jobs collection. This collection manages the jobs used in distributed testing.

Add jobs to the collection, specify their names and the order of their execution. You can also include the jobs in or exclude them from distributed testing. For more information on managing jobs, see Working With Jobs.

5. Specifying Tasks

Each job added to the Jobs collection contains tasks that define projects to be run on the specified slave hosts. Add tasks to the jobs and set their properties.

The task’s Host property specifies the host on which the project is executed and the Project file name property specifies the project’s location on the specified host.

The task’s properties allow you to set additional distributed testing properties. For example, you can define what specific slave project’s tests to be executed by the task, what application (TestComplete or TestExecute - a resource-friendly utility that was specifically created to run TestComplete projects on computers that do not have TestComplete installed) to be used for execution, set remote computer behavior after the task execution is finished, specify whether to copy the remote log to the master host and so on. For more information on this, see Editing Task Properties.

Tasks that belong to the same job are executed concurrently.

6. Specifying Synchronization for the Distributed Test

If you need to interact with projects runs on different remote computers, use synchronization provided by TestComplete:

  • NetworkSuite variables - These variables are shared among distributed projects and can be used for data exchanging. For more information on this, see Network Suite Variables.

  • NetworkSuite event handlers - Create custom handlers for the NetworkSuite events to make sure that distributed testing continues only when the specified network suite event occurs.

  • WaitForNetVarChange and WaitForState methods - Use the WaitForNetVarChange and WaitForState methods to suspend the distributed test execution until the specified variable’s value is modified or until the network suite’s, job’s or task’s state changes.

  • Critical sections - Critical sections are a marked segment of code that only allow one project access at a time. Use critical sections to make sure that different distributed projects do not access the same resources simultaneously. For more information on this, see Critical Sections.

  • Synchronization points - The NetworkSuite project item holds the SynchPoints collection that stores synchronization points. These points are used to suspend distributed project execution until the specified synchronization point is reached in each of them.

    Add synchronization points to all projects you want to synchronize. Place the NetworkSuite.Synchronize method call right before the piece of code that requires synchronization.

    For more information on synchronization points, see Synchronization Points.

7. Verifying the Distributed Test

To make sure that the distributed test will start successfully, perform verification. For information on how to perform verification, see Verifying Tasks, Jobs, Hosts and Network Suites.

You can verify the NetworkSuite as a whole or verify hosts, jobs and tasks separately.

If an error occurs during the verification, TestComplete displays a message indicating what has caused the verification to fail.

8. Running the Distributed Test

You can run the distributed test from the TestComplete UI, from keyword tests or scripts. For information on this, see Running the Network Suite, Jobs and Tasks.

During the test run, you can monitor the execution process via the Run State page of the Network Suite editor. The page displays the remote desktop windows of the slave hosts where the tasks are being executed and the state of each task. If you use synchronization in your test, the page also shows the synchronization event the tasks are waiting for.

9. Analyzing the Distributed Test Results

After distributed testing has finished, examine its test log. The distributed test log contains the logs of the projects executed on the slave hosts. Depending on the Copy test log property, slave projects’ test logs are either copied to the master computer, or loaded from the remote computers dynamically when you request them.

For more information on the distributed test log, see Network Suite Log.

Alternative Way of Creating Distributed Tests

An alternative way to create distributed tests is to use the Network Suite wizard. You can use the wizard to create a collection of tasks that execute a specific test on the selected remote computers.

The wizard significantly simplifies creation of distributed tests. You specify the desired test, select remote computers where the test will be run and specify the user account under which the test will be run. The host items corresponding to the selected computers, the tasks that will execute the test on the hosts and the job holding the tasks are created and configured automatically. The master project is also automatically configured to copy the test to the specified hosts when you run the test.

The major difference from the general approach described above is that the wizard allows creating distributed tests that execute tests that belong to your master project. If you want to execute tests that belong to other projects or project suites, create the corresponding tasks manually in the Tasks editor.

See Also

Distributed Testing
Distributed Testing - Requirements
Copying Slave Projects to Remote Computers
Opening User Sessions on Remote Computers
Verifying Tasks, Jobs, Hosts and Network Suites
Running the Network Suite, Jobs and Tasks

Highlight search results