Simulate Latency-Browsermob Proxy: Convert HAR to Locust Scenarios

I hope you had enjoyed reading the first article of this series Performance Capture I - Export HAR Using Selenium and BrowserMob-Proxy? Let's see how to simulate the latencies, get DOMContenLoaded time,  convert the HAR file to locust tasks to do performance testing.

Simulate Network Latencies

Browsermob proxy provides an option to limit the bandwidth through the proxy. This helps in identifies the bottlenecks in performance with slow networks. The limit function that takes a dictionary as it allows the users to play with the latencies. To reduce the bandwidth, just add the below lines to the server after starting the server.