Update: I’ve just answered my own question, in the reply below.
Hello,
Any idea on how can I simulate Offline network conditions on an Android device, that’s running an app with a Chrome WebView?
I’ve tried the following code:
((ExecuteCDPCommand) this.driver).executeCdpCommand("Network.emulateNetworkConditions", Map.of(
"offline", true,
"latency", 0,
"downloadThroughput", 0,
"uploadThroughput", 0));
But it doesn’t do anything.
Since AndroidDriver doesn’t implement the HasNetworkConditions interface, I’m unable to achieve what I usually do with Chromium based drivers, i.e., ((HasNetworkConditions)this.driver).setNetworkConditions(chromiumNetworkConditions);