Copying Slave Projects to Remote Computers

Applies to TestComplete 14.93, last modified on October 12, 2021
The Network Suite functionality is deprecated. We don’t recommend using it for distributed testing. Consider using a CI/CD system for managing distributed tests. See Migrating Distributed Tests to CI/CD Systems for details. In case you need to run web tests on multiple environments in parallel, you can also try using your project’s Execution Plan.

Distributed testing involves running slave projects on multiple remote computers controlled by the master project.

Before a distributed test starts, the slave projects must be placed to locations available for remote computers. You can store the slave projects in a shared network folder (not recommended) or on the remote computers where they should be run.

In the second case, instead of creating slave projects on remote computers, you can create and configure them on the master computer and then copy to the remote computers.

You can configure your master project to upload the slave projects to the remote computers automatically when the test starts or you can copy them manually from TestComplete IDE, from tests or by using file managers.

Note: If the tests you want to run on remote computers belong to your master project and you use the Network Suite wizard to create distributed tests, your master project is automatically configured to copy tests to the corresponding remote computers.

Preparations

  • If the slave project or project suite to copy has external project items or projects that reside outside its folder, we recommend that you move those external items to the appropriate project or project suite folder. Otherwise, TestComplete will not copy them. Make sure that the project or project suite contains valid paths to those external project items or projects.

  • On the master computer, open the master project in TestComplete.

  • Open the Hosts editor. To do this, double-click the Network Suite | Hosts item.

  • For each remote computer, to which you are going to copy a slave project:

    • Locate the appropriate host on the list. Make sure the computer name (or IP address) and the domain, user name and password of the account you want to use are specified for the host.

    • The Source path column of the editor specifies the folder on the local (master) computer that contains the project (project suite) to copy to the remote computer.

      By default, the column contains the [Path to the current project suite] value that corresponds to the folder that holds the current master project. You can create and configure your slave tests as part of your master project and then copy them to remote computers.

      If the desired test belongs to another project suite, specify the path to the folder containing that project suite. For example, D:\DistributedTest\Slave.

    • In the Base path column, specify the destination folder on the remote computer to which you want to place the slave project (project suite). For example, C:\Tests.

      Note: If you use the Network Suite wizard to create distributed tests, the destination folder is specified in the Base path column automatically.

Configuring the Network Suite to Copy Slave Projects Automatically

  • Open the Network Suite Properties page. To do this, double-click the Network Suite node and switch to the Properties page.

  • The Properties page contains the settings that affect the entire network suite. Set the Deploy mode option’s value to Automatic. When you run a distributed test, TestComplete will automatically copy projects located in source folders on the master computer to the destination folders on remote computers.

  • If you do not want TestComplete to copy slave projects automatically, set the Deploy mode to Manual.

Notes:
  • If you use the Network Suite wizard to create distributed tests, the network suite’s deploy mode is automatically set to Automatic.

  • You can control the network suite’s deploy mode from tests by using the NetworkSuite.DeployMode property.

Copying Slave Projects From the TestComplete IDE

  • Select the needed host in the Hosts editor. To select multiple hosts, use the Ctrl+ and Shift+ clicks.

  • Click the Copy Project to Slave button on the toolbar of the Hosts editor.

    -- or --

    Right-click the selection and choose Copy Project to Slave from the context menu.

Copying Slave Projects From Tests

In your master project’s test, call the Host.CopyProjectToSlave method. It copies the project located in the source folder on the master computer to the destination folder on a remote computer.

The method does not have any parameters. You specify the source folder located on the master computer and the destination folder located on the remote computer using the Source path and Base path parameters in the Hosts Editor. If one of these parameters is not specified, CopyProjectToSlave does nothing.

JavaScript, JScript

// Copy the project to SlaveComputer1
NetworkSuite.Hosts.ItemByName("SlaveComputer1").CopyProjectToSlave();
// …
// Run the network suite
NetworkSuite.Run(true);

Python

# Copy the project to SlaveComputer1
NetworkSuite.Hosts.ItemByName("SlaveComputer1").CopyProjectToSlave()
# ...
# Run the network suite
NetworkSuite.Run(True)

VBScript

' Copy the project to SlaveComputer1
NetworkSuite.Hosts.ItemByName("SlaveComputer1").CopyProjectToSlave
' …
' Run the network suite
NetworkSuite.Run True

DelphiScript

// Copy the project to SlaveComputer1
NetworkSuite.Hosts.ItemByName('SlaveComputer1').CopyProjectToSlave;
// …
// Run the network suite
NetworkSuite.Run(true);

C++Script, C#Script

// Copy the project to SlaveComputer1
NetworkSuite["Hosts"]["ItemByName"]("SlaveCompute1")["CopyProjectToSlave"]();
// …
// Run the network suite
NetworkSuite["Run"](true);

To call CopyProjectToSlave from a keyword test, use the Call Object Method or Run Code Snippet operation.

Notes:

  • You must call CopyProjectToSlave before starting the network suite (or any of its jobs or tasks).

  • CopyProjectToSlave does not copy unsaved changes made to the project during the test run (for example, changes to project or project suite variables). To share values between the master and remote computers, use network suite variables.

Remarks

  • TestComplete does not copy external project items and projects that belong to your slave project or project suite, but reside outside the Source path folder. Place those project items or projects in the Source path folder before copying your projects to remote computers or copy them to remote computers manually by using any file manager. Make sure that the slave project (or project suite) on the remote computer contains valid paths to those project items or projects and can access them.

  • TestComplete does not copy projects’ Log folder.

See Also

Creating and Running Distributed Tests
Distributed Testing
Projects Participating in Distributed Testing
CopyProjectToSlave Method
Host Object

Highlight search results