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
NetworkSuite.Stop();
Python
if not NetworkSuite.WaitForNetVarChange("VisualTestPassed", True, 600000):
NetworkSuite.Stop()
VBScript
NetworkSuite.Stop
End If
DelphiScript
NetworkSuite.Stop;
C++Script, C#Script
NetworkSuite["Stop"]();
See Also
Distributed Testing
OnNetVarChange Event
Network Suite Variables
NetworkSuite.Variables
NetworkSuite.WaitForState