SetNetworkConnection
Description
Use this command to set the network connection for a device.
Parameters
Name | Type | Possible Values | Description |
---|---|---|---|
Connection | String | * airplane_mode * wifi * mobile_data * Bluetooth | Connection type. |
Enable | Boolean | * 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.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
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:
- Under Developer Options turn off MIUI optimization.
- Reboot the device.
- Under Settings go to Permissions.
- Click the gear icon.
- Turn off the Permission Manager.