NetworkSuite.WaitForNetVarChange Method

Applies to TestComplete 15.20, last modified on January 19, 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 WaitForNetVarChange method delays script execution in the current project until the value of the specified network suite variable changes definitely or the specified time limit is reached.

Declaration

NetworkSuite.WaitForNetVarChange(VarName, VarValue, WaitTime)

VarName [in]    Required    String    
VarValue [in]    Required    Variant    
WaitTime [in]    Optional    Integer Default value: 0   
Result Boolean

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

VarName

The name of the needed network suite variable. Though you have to put the NetworkSuite.Variables. prefix before the variable name when using network suite variables in scripts, it should not be used with WaitForNetVarChange.

VarValue

The value of the network suite variable to be waited for.

WaitTime

Sets the time limit in milliseconds. 0 (the default value) means the waiting time is infinite.

Result Value

True if the expected value is set to this variable, and False otherwise.

Example

The following script halts the network suite's execution if the network suite variable VisualTestPassed doesn't get the True value within the specified period.

JavaScript, JScript

if (!NetworkSuite.WaitForNetVarChange("VisualTestPassed", true, 600000))
  NetworkSuite.Stop();

Python

if not NetworkSuite.WaitForNetVarChange("VisualTestPassed", True, 600000):
  NetworkSuite.Stop()

VBScript

If NetworkSuite.WaitForNetVarChange("VisualTestPassed", True, 600000) = False Then
  NetworkSuite.Stop
End If

DelphiScript

if not NetworkSuite.WaitForNetVarChange('VisualTestPassed', true, 600000) then
  NetworkSuite.Stop;

C++Script, C#Script

if (!NetworkSuite["WaitForNetVarChange"]("VisualTestPassed", true, 600000))
  NetworkSuite["Stop"]();

See Also

Distributed Testing
OnNetVarChange Event
Network Suite Variables
NetworkSuite.Variables
NetworkSuite.WaitForState

Highlight search results