Saltar al contenido principal

powerCapacity

Set the battery percentage on the Android emulator. Value must be in the range [0, 100].

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

Usage
browser.powerCapacity(percent)
Parameters
NameTypeDetails
percentnumberThe battery percentage to set (0–100)
Example
powerCapacity.js
it('should set battery to 75%', async () => {
await browser.powerCapacity(75)
})
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