NetworkSuite.Stop Method

Applies to TestComplete 14.71, last modified on April 22, 2021

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