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 Address
property returns the IP address of the computer that runs the current project via the network suite. If the computer is connected to several networks, the property returns the computer’s IP address in the first available network. You can view the list of all computer network connections in the Adapters and Bindings | Connections list (see Remarks).
Declaration
Applies To
The property is applied to the following object:
Property Value
A string that contains the computer’s IP address.
Remarks
To view the Adapters and Binding | Connections list containing the computer’s network connections, follow the instructions below:
-
In the Control Panel, go to Network and Internet > Network and Sharing Center.
-
In the Network and Sharing Center window, click Change adapter settings on the left.
-
Press ALT to invoke the main menu, and select Advanced > Advanced Settings from the menu.
-
In the Advanced Settings dialog, select the Adapters and Bindings tab which contains the list of the computer’s network connections.
Example
The following script demonstrates how you can use the NetworkSuite.Address
property to specify the base path of test projects that run on the computer as part of the network suite.
JavaScript, JScript
function NetworkSuiteSample()
{
// Adds a new host to the Hosts collection
var Host = NetworkSuite.Hosts.AddNew();
// Specifies the new host's properties
Host.Name = "SlaveComputer1";
Host.Address = "TEST-XP32";
Host.Domain = "Domain";
Host.UserName = "tester";
Host.Password = "password";
…
// Obtains the IP address of the current computer
// And uses it to specify the path to the base folder
Host.BasePath = "\\\\" + NetworkSuite.Address + "\\Distributed Testing";
…
}
Python
def NetworkSuiteSample():
# Adds a new host to the Hosts collection
Host = NetworkSuite.Hosts.AddNew()
# Specifies the new host's properties
Host.Name = "SlaveComputer1"
Host.Address = "TEST-XP32"
Host.Domain = "Domain"
Host.UserName = "tester"
Host.Password = "password"
# Obtains the IP address of the current computer
# And uses it to specify the path to the base folder
Host.BasePath = "\\\\" + NetworkSuite.Address + "\\Distributed Testing"
VBScript
Sub NetworkSuiteSample
Dim Host
' Adds a new host to the Hosts collection
Set Host = NetworkSuite.Hosts.AddNew
' Specifies the new host's properties
Host.Name = "SlaveComputer1"
Host.Address = "TEST-XP32"
Host.Domain = "Domain"
Host.UserName = "tester"
Host.Password = "password"
…
' Obtains the IP address of the current computer
' And uses it to specify the path to the base folder
Host.BasePath = "\\" & NetworkSuite.Address & "\Distributed Testing"
…
End Sub
DelphiScript
procedure NetworkSuiteSample;
var Host;
begin
// Adds a new host to the Hosts collection
Host := NetworkSuite.Hosts.AddNew;
// Specifies the new host's properties
Host.Name := 'SlaveComputer1';
Host.Address := 'TEST-XP32';
Host.Domain := 'Domain';
Host.UserName := 'tester';
Host.Password := 'password';
…
// Obtains the IP address of the current computer
// And uses it to specify the path to the base folder
Host.BasePath := '\\' + NetworkSuite.Address + '\Distributed Testing';
…
end;
C++Script, C#Script
function NetworkSuiteSample()
{
// Adds a new host to the Hosts collection
var Host = NetworkSuite["Hosts"]["AddNew"]();
// Specifies the new host's properties
Host["Name"] = "SlaveComputer1";
Host["Address"] = "TEST-XP32";
Host["Domain"] = "Domain";
Host["UserName"] = "tester";
Host["Password"] = "password";
…
// Obtains the IP address of the current computer
// And uses it to specify the path to the base folder
Host["BasePath"] = "\\\\" + NetworkSuite["Address"] + "\\Distributed Testing";
…
}
See Also
Distributed Testing
NetworkSuite.ProjectType
NetworkSuite.State