Open NickAb opened 9 years ago
Programmatic network throttling can be achieved using classes from %PROGRAMFILES(X86)%\Microsoft XDE\8.1\Microsoft.Xde.Interface.dll](Microsoft.Xde.Interface.dll
using Microsoft.Xde.Interface;
//...
client = AutomationClient.CreateAutomationClient(this.emulatorVm.Name);
client.IsNetworkSimulationEnabled = true
client.NetThrottlingSpeed = NetworkThrottlingSpeed.NoNetwork;
But network throttling will affect InnerServer
and, if network is turned off, render it unable to respond to Driver
commands.
Further research is need on how to bypass network throttling for InnerServer <-> Driver
communications. XDE itself uses network connection to interact with Emulator, so it is possible to bypass throttling, but it is unclear how to do so at the moment.
One easy solution will be switching from network communications to file based communications. This will give following benefits:
Driver
Drawbacks:
Add commands to switch phone network off, set it to different speed limits, etc. See related sections in: https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#value-alias-------data--wifi--airplane-mode- https://code.google.com/p/selenium/source/browse/spec-draft.md?repo=mobile#104