Pular para o conteúdo principal
🇺🇦  We stand with the people of Ukraine. We encourage compassion, and hope for peace.   🇺🇦
Please support humanitarian efforts for the Ukraine crisis through the International Committee of the Red Cross! #StandWithUkraine

toggleData

Set the mobile data state on the device.

Note: Falls back to the deprecated Appium 2 protocol endpoint if the driver does not support the mobile: execute method.

nota

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
browser.toggleData(enabled)
Parameters
NameTypeDetails
enabledbooleanSet 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

Support for android

nota

Refer to the official Appium driver documentation to see which driver versions support this command.

Welcome! How can I help?

WebdriverIO AI Copilot
Morty Proxy This is a proxified and sanitized view of the page, visit original site.