longPressKeyCode
Press and hold a particular key code on the device.
Usage​
await browser.longPressKeyCode(keycode, metastate, flags)
Parameters​
| Name | Type | Details |
|---|---|---|
keycode | number | The keycode to long-press (Android KeyEvent constant) |
metastateoptional | number | Meta state to apply during the key press (e.g. shift, ctrl) |
flagsoptional | number | Integer flags for the key event |
Example​
longPressKeyCode.js
it('should long press the Home button', async () => {
await browser.longPressKeyCode(3)
})
Support​
Supported platforms: Android
note
Refer to the official Appium driver documentation to see which driver versions support this command.