Press key command

Clicks on a single or sequence of special device keys (either control or keyboard). You can hover over the device keys to identify them, then enter the Keys parameter according to the required syntax.

Common keys include: LEFT, RIGHT, UP, DOWN, OK, BACK, MENU, VOL_UP, VOL_DOWN, CAMERA, CLEAR

Important: The listed keys are not necessarily supported by all devices. The available keys depend on the device.

Presskey will always press the keyboard keys according to the default layout configuration.

To press on Enter/Submit/Search, as the Keys parameter value, enter the following (supported on Android and iOS):

  • KEYBOARD_GO
  • KEYBOARD_SEARCH
  • KEYBOARD_SEND
  • KEYBOARD_NEXT
  • KEYBOARD_DONE
  • KEYBOARD_PREVIOUS
  • KEYBOARD_ENTER
  • KEYBOARD_SUBMIT

To activate Siri, use the value LONGHOME.

Parameters

Name Type Possible values Description

Device ID*

String

 

The device for this command. By default, this is the device under test (DUT).

Keys*

String

OK | MENU | HOME | BACK | LEFT | RIGHT | UP | DOWN | VOL_UP | VOL_DOWN | CAMERA | CLEAR | APP_SWITCH I LONGHOME

The physical device keys to press. You can select a sequence of comma-separated keys.

To define a long key press, use a colon follow by the time, in milliseconds. For example: END:3000

To embed a wait as part of the sequence, use WAIT= followed by the time, in milliseconds. For example: WAIT=2000

For multiple key presses, use an asterisk.

Examples:

3*OK

is the same as

OK,OK,OK

OK,WAIT=2000,2*DOWN,OK:3000

For iOS, the only supported values are HOME and LONGHOME.

Virtual keypad name

String

 

Specify the logical name of the virtual keypad to be used. A virtual keypad is defined as the keypad that pops up when user input is required.

Comment

String

 

Adds a comment to the script.

On-fail Result*

Condition

Ignore | Break | Continue | Abort | Catch

The behavior when the command fails.

* Mandatory parameter