toggleData
Set the mobile data state on the device.
note
Unlike the deprecated API which toggled the data state, this command requires an explicit
enabled parameter to set the desired state directly.
This command is only supported on Android.
Usage​
await browser.toggleData(enabled)
Parameters​
| Name | Type | Details |
|---|---|---|
enabled | boolean | Set to true to enable mobile data, false to disable it. |
Example​
toggleData.js
it('should set mobile data state', async () => {
await browser.toggleData(true) // enable data
await browser.toggleData(false) // disable data
})
Support​
Supported platforms: Android
note
Refer to the official Appium driver documentation to see which driver versions support this command.