The network throttling feature from Chrome DevTools is available in ChromeDriver-2.26+ according to this issue. How can I specify this in our protractor config file?
Based on searching around, I've tried variations of a couple things in the config file. I've added a networkConnectionEnabled
property and a prefs
block to chromeOptions, as below. (Note that I didn't do them both at the same time.)
multiCapabilities: [
{
'browserName': 'chrome',
'platform': 'ANY',
'networkConnectionEnabled': {'type': 'GPRS'},
'chromeOptions': {
args: [
'--lang=en',
'--window-size=1280,1024'
],
prefs: {
'net.throttling_enabled': 'true,50,20'
}
}
}
],
The second option I tried based on what I found here (line 1983). None of these change the behavior of the protractor run, which when I manually test and set the throttling triggers a certain condition in my code.
Edit: also tried adding something like this underchromeOptions: mobileEmulation: {networkConnectionEnabled: true, networkThrottle: '2G'}