NetworkSuite.WaitForNetVarChange Method

Applies to TestComplete 14.0, last modified on January 23, 2019

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(VarNameVarValueWaitTime)

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