NetworkSuite.Stop Method

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 Stop method unconditionally stops execution of the network suite defined in the current project.

Declaration

NetworkSuite.Stop()

Result None

Applies To

The method is applied to the following object:

Result Value

None.

Remarks

You cannot stop the network suite from the OnNetJobStateChange, OnNetSuiteStateChange and OnNetTaskStateChange event handlers.

Example

The following code snippet runs the network suite. If the network suite does not start running within the specified period of time, the code stops the network suite’s execution.

JavaScript, JScript

function NetworkSuiteSample()
{

  // Launches the network suite
  NetworkSuite.Run(false);
  // Stops the network suite if it does not start within the specified period of time
  if (! NetworkSuite.WaitForState(ns_Running, 1000 * 60))
    NetworkSuite.Stop();
  …
}

Python

def NetworkSuiteSample():
  # Launches the network suite
  NetworkSuite.Run(True)
  # Stops the network suite if it does not start within the specified period of time
  if not NetworkSuite.WaitForState(ns_Running, 1000 * 60):
    NetworkSuite.Stop

VBScript

Sub NetworkSuiteSample

  ' Launches the network suite
  Call NetworkSuite.Run(False)
  ' Stops the network suite if it does not start within the specified period of time
  If Not NetworkSuite.WaitForState(ns_Running, 1000 * 60) Then
    NetworkSuite.Stop
  End If
  …
End Sub

DelphiScript

procedure NetworkSuiteSample();
begin

  // Launches the network suite
  NetworkSuite.Run(false);
  // Stops the network suite if it does not start within the specified period of time
  if not NetworkSuite.WaitForState(ns_Running, 1000 * 60) then
    NetworkSuite.Stop;
  …
end;

C++Script, C#Script

function NetworkSuiteSample()
{

  // Launches the network suite
  NetworkSuite["Run"](false);
  // Stops the network suite if it does not start within the specified period of time
  if (! NetworkSuite["WaitForState"](ns_Running, 1000 * 60))
    NetworkSuite["Stop"]();
  …
}

See Also

Distributed Testing
NetworkSuite.ProjectType
NetworkSuite.Run

Highlight search results