ProjectSourcePath Property

Applies to TestComplete 15.45, last modified on December 01, 2022
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.

Description

The ProjectSourcePath property specifies the path to the folder on the master computer where the needed slave project is located. The path is used to copy the slave project from the master computer to the remote computer specified by the current host. This property corresponds to the Source path property of the host.

Declaration

HostObj.ProjectSourcePath

Read-Write Property String
HostObj An expression, variable or parameter that specifies a reference to a Host object

Applies To

The property is applied to the following object:

Property Value

A string that represents the path to the slave project.

Remarks

The path must be master-relative.

If the ProjectSourcePath property of HostObj is not specified, it is considered equal to the path to the current project suite folder.

Example

The following example adds a remote computer to a network suite (distributed test), copies a test project from the current computer to the remote computer and starts the network suite.

JavaScript, JScript

function CopyProjectToSlave()
{
  // Create a new host
  var Host = NetworkSuite.Hosts.AddNew();
  // Specify the connection properties of the host
  Host.Name = "NewHost";
  Host.Address = "TEST-W764";
  // ...
  // Specify the base path and source path host properties
  Host.ProjectSourcePath = "C:\\Work\\MyProjects\\";
  Host.BasePath = "C:\\SlaveProjects\\";
  // Copy the project from the master computer to a slave computer
  Host.CopyProjectToSlave();
  // ...
  // Run the network suite
  NetworkSuite.Run(true);
}

Python

def CopyProjectToSlave():
  # Create a new host
  Host = NetworkSuite.Hosts.AddNew()
  # Specify the connection properties of the host
  Host.Name = "NewHost"
  Host.Address = "TEST-W764"
  Host.UserName = "tester"
  Host.Password = "123"
  # ...
  # Specify the base path and source path host properties
  Host.ProjectSourcePath = "C:\\Work\\MyProjects\\"
  Host.BasePath = "C:\\SlaveProjects\\"
  # Copy the project from the master computer to a slave computer
  Host.CopyProjectToSlave()
  # ...
  # Run the network suite
  NetworkSuite.Run(True)

VBScript

Sub CopyProjectToSlave
  Dim Host
  ' Create a new host
  Set Host = NetworkSuite.Hosts.AddNew
  ' Specify the connection properties of the host
  Host.Name = "NewHost"
  Host.Address = "TEST-W764"
  ' ...
  ' Specify the base path and source path host properties
  Host.ProjectSourcePath = "C:\Work\MyProjects\"
  Host.BasePath = "C:\SlaveProjects\"
  ' Copy the project from the master computer to a slave computer
  Host.CopyProjectToSlave
  ' ...
  ' Run the network suite
  NetworkSuite.Run True
End Sub

DelphiScript

procedure CopyProjectToSlave;
var Host;
begin
  // Create a new host
  Host := NetworkSuite.Hosts.AddNew;
  // Specify the connection properties of the host
  Host.Name := 'NewHost';
  Host.Address := 'TEST-W764';
  // ...
  // Specify the base path and source path host properties
  Host.ProjectSourcePath := 'C:\Work\MyProjects\';
  Host.BasePath := 'C:\SlaveProjects\';
  // Copy the project from the master computer to a slave computer
  Host.CopyProjectToSlave;
  // ...
  // Run the network suite
  NetworkSuite.Run(true);
end;

C++Script, C#Script

function CopyProjectToSlave()
{
  // Create a new host
  var Host = NetworkSuite["Hosts"]["AddNew"]();
  // Specify the connection properties of the host
  Host["Name"] = "NewHost";
  Host["Address"] = "TEST-W764";
  // ...
  // Specify the base path and source path host properties
  Host["ProjectSourcePath"] = "C:\\Work\\MyProjects\\";
  Host["BasePath"] = "C:\\SlaveProjects\\";
  // Copy the project from the master computer to a slave computer
  Host["CopyProjectToSlave"]();
  // ...
  // Run the network suite
  NetworkSuite["Run"](true);
}

See Also

Distributed Testing
Address Property
State Property
BasePath Property

Highlight search results