Run a test using an emulated network
Relevant for: GUI tests and components
This task describes how to trigger a network emulation session from UFT One and run tests on the virtualized network. This enables you to view how your network performs while your application is running.
Check out the blog on the topic at the All About the Apps blog!
Before running a test with a virtualized network, you must:
Have access to the Network Virtualization Test Manager location.
Create the necessary profiles in the NV Test Manager. For details, see the Network Virtualization Help Center.
In the Network Virtualization pane of the Options dialog (Tools > Options > General tab > Network Virtualization node), enter the following:
The URL of the NV Test Manager, in the format http://<NV Test Manager Address>:<NV Test Manager Port>
User name and password
Select Use Proxy to connect via the proxy set in your Windows Internet Options.
In your test or component, add a step to trigger an emulation session start:
The profile name used is taken from the Profiles page in the NV Test Manager.
When an network emulation is started using the NV.StartEmulation or NV.StartEmulationExcludeIPs methods, the method returns a token with an emulation ID.
Use this emulation ID to stop the emulation session, using the NV.StopEmulation method.
token = NV.StartEmulation("profile name")
Note: You can name the token variable in the example above to any name.
The network conditions in your network emulation profile are defined for multiple networks. However, when running a particular network emulation, you may want to exclude specific networks from that emulation.
When running a specific network emulation, you may want exclude networks (IP addresses) from that emulation. Do so for all sessions via the Options dialog box, or in the step code for a specific test or component:
In the Network Visualization pane of the Options dialog box, add IP addresses to exclude from all network emulation sessions launched from UFT One.
Maximum: 200 addresses
|A specific session
In your test or component, enter a step using the .Start EmulationExcludeIPs method:
NV.StartEmulationExcludeIPs("profile name", array of excluded IPs)
These IP address are excluded only from the current emulation session.
You may want to update the emulation details in real-time conditions to simulate real performance.
Use one of the following methods to update the emulation:
Add a NV.ModifyEmulationDetails method and provide the parameter values:
When the step runs, the currently running emulation is updated according to these parameters and simulated accordingly.
For some Network Virtualization tests, save the emulation details loaded during a test run in your profile.
For these scenarios, add a NV.ModifyEmulationProfile method and specify the profile name.
When the step runs, the currently running emulation is updated according to the details in the specified profile.
This step works the same as the UpdateEmulationFromProfile method, but is used when the test containing the profile is not running in the NV Test Manager.
Insert this step and UFT One starts the test containing the specified profile.
After you have configured the connection information for the NV Test Manager, and added the necessary statements to your test, run the test.
An icon is displayed in the UFT One status bar to indicate that the network virtualization is started.
In addition, you can see the network emulation running in the NV Test Manager.
In the run results, each emulation Start and Stop step is displayed separately. For full details on the network emulation performance, see your NV Test Manager test results.