Legacy | Network virtualization start
-
Command: vnetwork
-
Subcommand: start
-
Supported Platforms: Native (legacy), UFT (legacy), Selenium, Appium
All commands must be executed using the same framework. Sharing the execution ID between different frameworks is not possible. This means that if you work with a Selenium/Appium driver, you need to call the commands using the Selenium/Appium driver (or, in the case of Reporting commands, through the Reporting SDK that works with the driver) and not as part of a UFT test or another framework.
-
Supported OS: Android, iOS
Description
Starts network virtualization for the device with the specified conditions. Network virtualization will be stopped when the script ends.
For network condition testing, the device used is connected to the Web via Perfecto WiFi. Setup is completed by Perfecto.
Use the Network virtualization start and update commands to activate and update the network conditions. Without this activation, there is no effect on the device communication to the web.
Selecting latency effects both in and out traffic. For example, selecting latency of 100 results in the actual latency being 200 (100 each way).
For typical network emulation values, see Network conditions for network virtualization.
The following table lists emulation values of problematic networks.
Problematic Level |
Packet loss (%) |
Corruption (%) |
Duplication(%) |
Reorder |
---|---|---|---|---|
Steady Network |
1 |
0 |
0 |
2 |
Noisy Network |
2 |
2 |
0 |
5 |
Unstable Network |
3 |
3 |
2 |
10 |
Very Unstable Network |
5 |
5 |
5 |
20 |
Parameters
Name | Value | Default | Description |
---|---|---|---|
deviceId* |
The device for this command. | ||
latency |
Latency applied on packets in the Network. Effective values are in the range of 0-8000 ms. |
||
packetLoss |
Network packet loss. Effective values are in the range of 0-100%. A reasonable packet loss value should not exceed 5%. |
||
bandwidth.in |
Limitation on the allowed download network bandwidth into the device. Effective values are in the range of 3-100,000 Kbps, or unlimited. |
||
bandwidth.out |
Limitation on the allowed upload network bandwidth from the device. Effective values are in the range of 3-100,000 Kbps, or unlimited. |
||
packetCorruption |
Network packet corruption. Effective values are in the range of 0-100%. A reasonable packet corruption value should not exceed 5%. |
||
packetReordering |
The percentage of network packets sent immediately without any delay. Used alongside the Latency parameter. Moreover, the packets that are sent immediately will arrive earlier than the packets that were delayed by the defined latency value, essentially creating a packet reordering. Effective values are in the range of 0-100%. A reasonable packet reordering value should not exceed 10%. |
||
packetDuplication |
Network packets duplicated. Effective values are in the range of 0-100%. A reasonable packet duplication value should not exceed 3%. |
||
delayJitter |
Random latency variation; the actual latency between latency +- jitter. Used alongside the Latency parameter.Effective values are in the range of 0-8000 ms. For example, if the latency is defined to be 100 ms and the jitter is 10 ms, this causes the added delay to be 100ms - 10ms. |
||
correlation |
Network packet value correlation, affecting the Latency, Corruption, Reordering and Duplication. Effective values are in the range of 0-100%. For Latency, Corruption, Reordering and Duplication, the current packet n value will be correlated by this % to previous packet n-1 value. In other words, the current packet value is correlated to the previous packet value. For example, if the correlation is defined to be 25%, the packet loss is 5%, and the previous packet was lost, then the updated packet loss value (for the current packet) would be 75% * 5% + 25%, which equals 28.75%. However, if the previous packet was not lost, then the packet loss value would be 75% * 5%, which equals 3.75%. |
||
blockedDestinations |
Network packet block, to specific destinations, defined by domain name, IP address, and IP range destinations in IP Prefix (Slash) notation. Examples: Domain name: www.google.com IP address: 192.168.2.0 IP range destination: 192.168.2.0/24 To remove a network packet block, prefix the value with a '-'. For example, -www.google.com. |
||
blockedPorts |
Network packet block, to specific ports. For example, to block http, define port number 80. To remove a network packet block, prefix the value with a '-'. For example, -80. |
||
generateHarFile |
true (True) false (False) |
Indicates if a HTTP Archive (HAR) file should be generated to analyze the traffic of the virtual network. |
|
profile |
2g_gprs_good (2G GPRS Good) 2g_gprs_average (2G GPRS Average) 2g_gprs_poor (2G GPRS Poor) 2g_edge_good (2G Edge Good) 2g_edge_average (2G Edge Average) 2g_edge_poor (2G Edge Poor) 3g_umts_good (3G UMTS Good) 3g_umts_average (3G UMTS Average) 3g_umts_poor (3G UMTS Poor) 3.5g_hspa_good (3.5G HSPA Good) 3.5g_hspa_average (3.5G HSPA Average) 3.5g_hspa_poor (3.5G HSPA Poor) 3.5g_hspa_plus_good (3.5G HSPA PLUS Good) 3.5g_hspa_plus_average (3.5G HSPA PLUS Average) 3.5g_hspa_plus_poor (3.5G HSPA PLUS Poor) 4g_lte_good (4G LTE Good) 4g_lte_average (4G LTE Average) 4g_lte_poor (4G LTE Poor) 4g_lte_advanced_good (4G LTE Advanced Good) 4g_lte_advanced_average (4G LTE Advanced Average) 4g_lte_advanced_poor (4G LTE Advanced Poor) bandwidth_good (Bandwidth Good) |
Suggested network virtualization profiles. See the Suggested Profiles table, in the description section above, for the defined emulation values. Note: Specifying additional network virtualization parameters will override their values in the suggested profile. |
* Mandatory parameter
Request & Response
Request
https://mycloud.perfectomobile.com/services/executions/john@perfectomobile.com_controller_16-11-09_12_44_59_31771?operation=command&securityToken=<your_token>&command=vnetwork&subcommand=start¶m.deviceId=FA53XYJ18894¶m.profile=2g_gprs_good
JSON response
{
"reason": "Success",
"timer.elapsed": "750",
"returnValue": "1.0.53.13:686",
"testGridReportUrl": "https://mycloud.reporting-01.perfectomobile.com?externalId[0]=john@perfectomobile.com_controller_16-11-09_12_44_59_31771",
"description": "Success",
"timer.system": "750",
"completed": "true",
"flowEndCode": "SUCCEEDED",
"executionId": "john@perfectomobile.com_controller_16-11-09_12_44_59_31771",
"timer.ux": "0",
"singleTestReportUrl": "https://mycloud.perfectomobile.com/nexperience/singletest/report/?reportRepositoryKey=PRIVATE:controller/161109/controller_16-11-09_12_44_59_31771.xml&ownerId=john@perfectomobile.com&sharingCode=993fbf5a-7d97-4390-892e-734fac09c4dd",
"reportKey": "PRIVATE:controller/161109/controller_16-11-09_12_44_59_31771.xml",
"timer.device": "0"}