Pular para o conteúdo principal

longPressKeyCode

Press and hold a particular key code on the device.

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

Usage

await browser.longPressKeyCode(keycode, metastate, flags)

Parameters

NameTypeDetails
keycodenumberThe keycode to long-press (Android KeyEvent constant)
metastate
optional
numberMeta state to apply during the key press (e.g. shift, ctrl)
flags
optional
numberInteger flags for the key event

Example

longPressKeyCode.js
it('should long press the Home button', async () => {
await browser.longPressKeyCode(3)
})

Support

Support for android

Supported platforms: 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