Simulating Network Throttling - Desktop Web and Mobile Web
Learn to automate the network throttling simulation for desktop web and mobile web.
In the previous lesson we discussed network throttling and its importance. Now let’s learn to simulate it via automation.
Example 1 - simulate network throttling for educative.io on desktop web
In this example, we will simulate the educative.io website launch under different network conditions.
Let’s look at the below code and explanation.
Code output
Here, in the output, we can see the throughput, latency, and overall page load time for different network presets.
time taken to load url https://www.educative.io/ with network throttle conf 'Regular4G': '{"offline":false,"downloadThroughput":524288,"uploadThroughput":393216,"latency":20}'=> 5532 ms
time taken to load url https://www.educative.io/ with network throttle conf 'WiFi': '{"offline":false,"downloadThroughput":3932160,"uploadThroughput":1966080,"latency":2}'=> 6289 ms
time taken to load url https://www.educative.io/ with network throttle conf 'Good3G': '{"offline":false,"downloadThroughput":196608,"uploadThroughput":96000,"latency":40}'=> 7267 ms
time taken to load url https://www.educative.io/ with network throttle conf 'Regular3G': '{"offline":false,"downloadThroughput" ...