2gis / Winium.Mobile

Winium.Mobile is Selenium Remote WebDriver implementation for automated testing of Windows StoreApps and Silverlight apps, tested on emulators (currently only Windows Phone/Mobile apps are supported).
Mozilla Public License 2.0
51 stars 29 forks source link

Add commands to set network connection #67

Open NickAb opened 9 years ago

NickAb commented 9 years ago

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

NickAb commented 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:

Drawbacks: