메인 컨텐츠로 건너뛰기

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
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

참고

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

Welcome! How can I help?

WebdriverIO AI Copilot