Network virtualization start (FR)
Perfecto Command
mobile:vnetwork:start
Purpose
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 | Type | Possible Values | Description |
---|---|---|---|
latency | Integer | 0-8000ms | Latency applied on packets in the Network. |
packetLoss | Integer | 0-100% |
Network packet loss.. A reasonable packet loss value should not exceed 5%. |
bandwidth.in | Integer |
|
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 | Integer |
|
Limitation on the allowed upload network bandwidth from the device. Effective values are in the range of 3-100,000 Kbps, or unlimited. |
packetCorruption | Integer | 0-100% |
Network packet corruption. |
packetReordering | Integer | 0-100% |
The percentage of network packets sent immediately without any delay. |
packetDuplication | Integer | 0-100% |
Network packets duplicated.. |
delayJitter | Integer | 0-8000ms |
Random latency variation; the actual latency between latency +- jitter. Used alongside the Latency parameter. |
correlation | Integer | 0-100% |
Network packet value correlation, affecting the Latency, Corruption, Reordering and Duplication. |
generateHarFile | String | False | Indicates if a HTTP Archive (HAR) file should be generated to analyze the traffic of the virtual network. |
blockedDestinations | String |
|
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 | String |
|
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. |
profile | String | 2g_gprs_good | 2g_gprs_average | 2g_gprs_poor | 2g_edge_good | 2g_edge_average | 2g_edge_poor | 3g_umts_good | 3g_umts_average | 3g_umts_poor | 3.5g_hspa_good | 3.5g_hspa_average | 3.5g_hspa_poor | 3.5g_hspa_plus_good | 3.5g_hspa_plus_average | 3.5g_hspa_plus_poor | 4g_lte_good | 4g_lte_average | 4g_lte_poor | 4g_lte_advanced_good | 4g_lte_advanced_average | 4g_lte_advanced_poor | 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. |
Return Value
None
Exceptions
None
Examples
Java sample
Map<String, Object> pars = new HashMap<>();
pars.put("generateHarFile", "true");
driver.executeScript("mobile:vnetwork:start", pars);
C# sample
Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("profile", "3.5g_hspa_plus_good");
driver.ExecuteScript("mobile:vnetwork:start", pars);