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 Verify
method checks if the network suite can use the given host. That is, whether the host machine can be accessed through the network, whether TestComplete 14 or TestExecute 14 is installed on this machine and whether the TestComplete 14 Service is running on that machine.
Declaration
HostObj.Verify(ATimeOut)
HostObj | An expression, variable or parameter that specifies a reference to a Host object | |||
ATimeOut | [in] | Optional | Integer | Default value: 0 |
Result | Boolean |
Applies To
The method is applied to the following object:
Parameters
The method has the following parameter:
ATimeOut
Specifies the number of minutes the method waits until the host responds. If ATimeOut is 0, which is the default value, the method does not wait for the host to become available.
Result Value
True if the network suite can use the host, and False otherwise.
Example
The code below accesses a collection of hosts and then checks whether each host can be used by a network suite.
JavaScript, JScript
function VerifyingHosts()
{
// Access a collection of hosts
var colHosts = NetworkSuite.Hosts;
// Iterate through the hosts
for (var i = 0; i < colHosts.Count; i++)
{
// Access the current host
var Host = colHosts.Items(i);
// Verify that the current host can be used by a network suite
var VerifyRes = Host.Verify();
if (VerifyRes)
Log.Message("The "+ Host.Name +" host can be used by a network suite.")
else
Log.Warning("The "+ Host.Name +" host cannot be used by a network suite.");
}
}
Python
def VerifyingHosts():
# Access a collection of hosts
colHosts = NetworkSuite.Hosts
# Iterate through the hosts
for i in range (0, colHosts.count):
# Access the current host
Host = colHosts.Items[i]
# Verify that the current host can be used by a network suite
VerifyRes = Host.Verify()
if VerifyRes:
Log.Message("The "+ Host.Name +" host can be used by a network suite.")
else:
Log.Warning("The "+ Host.Name +" host cannot be used by a network suite.")
VBScript
Sub VerifyingHosts
' Access a collection of hosts
Set colHosts = NetworkSuite.Hosts
' Iterate through the hosts
For i = 0 to (colHosts.Count - 1)
' Access the current host
Set Host = colHosts.Items(i)
' Verify that the current host can be used by a network suite
VerifyRes = Host.Verify
If VerifyRes Then
Log.Message("The "& Host.Name &" host can be used by a network suite.")
Else
Log.Warning("The "& Host.Name &" host cannot be used by a network suite.")
End If
Next
End Sub
DelphiScript
function VerifyingHosts;
var colHosts, i, Host, VerifyRes;
begin
// Access a collection of hosts
colHosts := NetworkSuite.Hosts;
// Iterate through the hosts
for i := 0 to (colHosts.Count - 1) do
begin
// Access the current host
Host := colHosts.Items[i];
// Verify that the current host can be used by a network suite
VerifyRes := Host.Verify;
if (VerifyRes) then
Log.Message('The '+ Host.Name +' host can be used by a network suite.')
else
Log.Warning('The '+ Host.Name +' host cannot be used by a network suite.');
end;
end;
C++Script, C#Script
function VerifyingHosts()
{
// Access a collection of hosts
var colHosts = NetworkSuite["Hosts"];
// Iterate through the hosts
for (var i = 0; i < colHosts["Count"]; i++)
{
// Access the current host
var Host = colHosts["Items"](i);
// Verify that the current host can be used by a network suite
var VerifyRes = Host["Verify"]();
if (VerifyRes)
Log["Message"]( "The "+ Host["Name"] +" host can be used by a network suite." )
else
Log["Warning"]( "The "+ Host["Name"] +" host cannot be used by a network suite." );
}
}
See Also
Distributed Testing
State Property
Verifying Tasks, Jobs, Hosts and Network Suites