BasePath Property

Applies to TestComplete 15.47, last modified on January 20, 2023
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 BasePath property specifies the base path on the given host (the Base path property of the host). This path can be used to specify relative paths to desired projects that are to be run by job tasks on this host (see Task.ProjectPath).

Declaration

HostObj.BasePath

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 host’s base path.

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
ProjectPath Property

Highlight search results