LambdaTestAutomation Testing ● Network Throttling

Network Throttling

There might be instances where you would have to check the functionality of your website on low latency networks ( 2G/3G/LTE) or even offline. Such networks have variable upload and download speeds which can alter how your website performs on different browsers.

In order to validate your website on such network profiles, you can simulate these network conditions using our capabilities. If you want the test suite to start with the default network use our preset capabilities. However, the device will have unobstructed internet connectivity.

List Of Network Profiles

Condition Download Speed (kbps) Upload Speed (kbps) Latency (ms)
Offline 0 0 0
Reset Reset to default Reset to default Reset to default
GPRS 50 20 500
Regular 2G 250 50 300
Good 2G 450 150 150
Regular 3G 750 250 100
Good 3G 1 Mbps 750 20
Regular 4G 4 Mbps 3 Mbps 20
DSL 2 Mbps 1 Mbps 5

Custom Network Profile: For creating custom network conditions you can use objects. Define the upload speed, download speed, and latency for the custom condition, as shown in the above table.

Configuring Network Profile

The Selenium JavaScript Executor allows you to enable network simulation capabilities for tests and to generate custom log files. You can use conditional capabilities to simulate network conditions for individual test cases.

LambdaTest now allows you to select a network profile before running automation tests. This will allow you to conduct the functional tests of your website or web app on low/high latency networks and offline. In order to simulate the network conditions, you can use the networkProfile capability as shown below.

JavaScript Executor Command Request Parameters Example
networkProfile condition: a string or object representing browser network conditions driver.execute_script(“networkProfile”, {
“condition”: {
“download”: 500,
“upload”: 100,
“latency”: 30

Configuring Network Throttling In Test Automation

To configure network throttling in automation, we have used the TestNG github repository to run our automation tests. You would just have to define network throttle capabilities in your automation scripts.

The following below is the TestNG code. It will validate your LambdaTest credentials for authentication purposes. The code will select the basic capabilities such as OS, browser, browser version, network, and so on.

Here is the demo screenshot of the above-executed automation test. You can find your defined network capabilities under the section ‘Input Config’ by navigating to the ‘METADATA’ section of your automation build-logs.

In case you have any questions, feel free to share them with us.Our experts are available on 24×7 chat support. You can also drop us a mail at [email protected]. Happy testing! ?