Reputation: 278
How do you set the network throttling settings in chrome using selenium and javascript
Upvotes: 2
Views: 2152
Reputation: 126
It did take me a bit of time to figure this out as well, but this seemed to work for me
driver = await new Builder()
.forBrowser(engine)
.usingServer(testConfig.seleniumServer + 'wd/hub')
.setChromeOptions(new chrome.Options()) //.headless()
.build();
driver.setNetworkConditions({
offline: false,
latency: 15, // Additional latency (ms).
download_throughput: 50 * 1024, // Maximal aggregated download throughput.
upload_throughput: 50 * 1024 // Maximal aggregated upload throughput.
});
Upvotes: 1