Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The command gives the ability to set the network connection for a device.

Command works only for Android
Info
SEO Metadata
titleSetNetworkConnection

The command gives the ability to set the network connection for a device.

Parameters

NameValueDescription
Connection 

String with values as

  • airplane_mode
  • wifi
  • mobile_data
  • Bluetooth
Connection types
EnableBooleanEnable/Disable

...

Info

Set Experitest Url

Please make sure you replace <EXPERITEST_URL> with the appropriate URL in the code snippet below.

...

Code Block
languagejava
titleSetNetworkConnection
DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<EXPERITEST_URL>"), 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 added their own permission manager. It needs to be disabled in order to use this command.

In order to do disable Permission Manager:

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