NetworkSuite.Run Method

Applies to TestComplete 15.42, last modified on September 08, 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 Run method runs the network suite of the current project. This will run all the enabled tasks in all the enabled jobs of this network suite.

Declaration

NetworkSuite.Run(WaitForCompletion)

WaitForCompletion [in]    Required    Boolean    
Result None

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

WaitForCompletion

Specifies whether the network suite will be run simultaneously with the entire script execution flow.

If this parameter is False, the script execution will be suspended until the network suite's initialization finishes and then it will be resumed upon the start of the network suite's execution.

Note: If the script execution on the master computer finishes earlier than on the remote computers, the remote test execution is stopped automatically upon the end of the master script and an error message is posted to the test log. In order to avoid such a situation, you can call the NetworkSuite.WaitForState method with the State parameter set to ns_Idle at the end of the master script.

If WaitForCompletion is True, the script execution will be suspended until the execution of the network suite finishes.

Result Value

None.

Remarks

You cannot run the network suite from event handlers.

Example

The following code snippet launches the network suite to be run simultaneously with the entire script execution. If the network suite does not start running within one minute, the whole test execution stops.

JavaScript, JScript

function NetworkSuiteSample()
{
  // Launches the network suite
  NetworkSuite.Run(false);
  // If the network suite does not start running within the specified time period
  // The test execution stops
  if (! NetworkSuite.WaitForState(ns_Running, 1000 * 60))
    Runner.Stop();


  …

  NetworkSuite.WaitForState(ns_Idle);
}

Python

def NetworkSuiteSample():
  # Launches the network suite 
  NetworkSuite.Run(True)
  # If the network suite does not start running within the specified time period  
  # The test execution stops 
  if not NetworkSuite.WaitForState(ns_Running, 1000 * 60):
    Runner.Stop()
  NetworkSuite.WaitForState(ns_Idle)

VBScript

Sub NetworkSuiteSample

  ' Launches the network suite
  Call NetworkSuite.Run(False)
  ' If the network suite does not start running within the specified time period
  ' The test execution stops
  If Not NetworkSuite.WaitForState(ns_Running, 1000 * 60) Then
    Runner.Stop
  End If

  …

  Call NetworkSuite.WaitForState(ns_Idle)
End Sub

DelphiScript

procedure NetworkSuiteSample();
begin
  // Launches the network suite
  NetworkSuite.Run(false);
  // If the network suite does not start running within the specified time period
  // The test execution stops
  if not NetworkSuite.WaitForState(ns_Running, 1000 * 60) then
    Runner.Stop;


  …

  NetworkSuite.WaitForState(ns_Idle);
end;

C++Script, C#Script

function NetworkSuiteSample()
{
  // Launches the network suite
  NetworkSuite["Run"](false);
  // If the network suite does not start running within the specified time period
  // The test execution stops
  if (! NetworkSuite["WaitForState"](ns_Running, 1000 * 60))
    Runner["Stop"]();

  …

  NetworkSuite["WaitForState"](ns_Idle);
}

See Also

Distributed Testing
NetworkSuite.ProjectType
NetworkSuite.Stop
NetworkSuite.Verify
NetworkSuite.State
NetworkSuite.WaitForState

Highlight search results