Description
The State
property returns the state of the network suite in the current project.
Declaration
Applies To
The property is applied to the following object:
Property Value
An integer value that stands for the network suite’s state of the current project. Read the Network Suite States topic to learn about available network suite states.
Remarks
Use the NetworkSuite.WaitForState
method to delay script execution until the network suite reaches a particular state.
Example
The following code is an event handler for the OnNetSuiteStateChange event. Every time the event occurs, the network suite’s state is posted to the test log.
JavaScript, JScript
function GeneralEvents_OnNetSuiteStateChange(Sender)
{
Log.Message("New Network Suite State = " + aqConvert.IntToStr(NetworkSuite.State));
}
Python
# Handler for the event occurring each time the network suite state changes
def GeneralEvents_OnNetSuiteStateChange():
Log.Message("New Network Suite State = " + aqConvert.IntToStr(NetworkSuite.State))
VBScript
Sub GeneralEvents_OnNetSuiteStateChange(Sender)
Log.Message("New Network Suite State = " + aqConvert.IntToStr(NetworkSuite.State))
End Sub
DelphiScript
procedure GeneralEvents_OnNetSuiteStateChange(Sender: OleVariant);
begin
Log.Message('New Network Suite State = ' + aqConvert.IntToStr(NetworkSuite.State));
end;
C++Script, C#Script
function GeneralEvents_OnNetSuiteStateChange(Sender)
{
Log["Message"]("New Network Suite State = " + aqConvert["IntToStr"](NetworkSuite["State"]));
}
See Also
Distributed Testing
NetworkSuite.ProjectType Property
NetworkSuite.Tag Property
NetworkSuite.Run Method
NetworkSuite.Stop Method
NetworkSuite.WaitForState Method
OnNetSuiteStateChange Event