Skip to main content

SetNetworkConnection

Description

Use this command to set the network connection for a device.

Parameters

NameTypePossible ValuesDescription
ConnectionString* airplane_mode

* wifi

* mobile_data

* Bluetooth
Connection type.
EnableBoolean* True - Enable the network connection type.

* False - Disable the network connection type.
Enable and disable a connection type.

Usage

info

Replace <server> with the appropriate URL.

Example

SetNetworkConnection

DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "<deviceid>");

...
...
//Set the Network connection as airplane_mode
seetest.setNetworkConnection("airplane_mode", true);

Note: Some Xiaomi devices with Android 6 and MIUI 9 Xiaomi have their own permission manager. It needs to be disabled in order to use this command.

In order to do disable Permission Manager:

  1. Under Developer Options turn off MIUI optimization.
  2. Reboot the device.
  3. Under Settings go to Permissions.
  4. Click the gear icon.
  5. Turn off the Permission Manager.