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 Items
property returns a host specified by the index it has in the host collection represented by the Hosts
object.
Declaration
HostsObj.Items(Index)
Read-Only Property | A Host object |
HostsObj | An expression, variable or parameter that specifies a reference to a Hosts object | |||
Index | [in] | Required | Integer |
Applies To
The property is applied to the following object:
Parameters
The property has the following parameter:
Index
The index of the desired host in the host collection. The index ranges between 0 and Hosts.Count
- 1.
Property Value
A Host
object.
Remarks
If you use Python or DelphiScript, you should enclose the parameter of the Items
property in square brackets: Items[Index]
.
Since the Items
property is the default property for the Hosts
object, you can omit the name of this property when referring to a collection item. Therefore, the following code lines are equivalent:
JavaScript, JScript
Host = NetworkSuite.Hosts.Items(0);
// -- or --
// Using the Items property implicitly
Host = NetworkSuite.Hosts(0);
Python
# Using the Items property explicitly
Host = NetworkSuite.Hosts.Items[0]
# -- or --
# Using the Items property implicitly
Host = NetworkSuite.Hosts[0]
VBScript
Set Host = NetworkSuite.Hosts.Items(0)
' -- or --
' Using the Items property implicitly
Set Host = NetworkSuite.Hosts(0)
DelphiScript
Host := NetworkSuite.Hosts.Items[0];
// -- or --
// Using the Items property implicitly
Host := NetworkSuite.Hosts[0];
C++Script, C#Script
Host = NetworkSuite["Hosts"]["Items"](0);
// -- or --
// Using the Items property implicitly
Host = NetworkSuite["Hosts"](0);
Example
To view the examples that demonstrate how to use this property, see the help topics describing the methods and properties that belong to the Host
object.
See Also
Distributed Testing
Hosts.Count
Hosts.ItemByName
Hosts.AddNew
Host Object
Host.Index