Skip to content

tapOnPoint ​

Tap or press at a screen coordinate.

The tapOnPoint command taps (or presses and holds) a coordinate on the screen. Use it when there is no element to select. To tap an element, use tapOn, which also accepts a point.

Parameters ​

Give either point, or x and y.

ParameterTypeDescription
pointString"x, y" in absolute pixels ("100, 200") or percent of the screen ("50%, 50%"). When set, it replaces x and y.
xIntegerAbsolute x coordinate.
yIntegerAbsolute y coordinate.
longPressBooleanIf true, press and hold instead of tapping.
durationIntegerHold time in milliseconds. Setting it makes the step a press. If longPress is true without duration, it holds for 1 second.

Usage examples ​

Tap the center of the screen:

yaml
- tapOnPoint:
    point: "50%, 50%"

Tap an absolute coordinate:

yaml
- tapOnPoint:
    x: 120
    y: 640

Press and hold for 2 seconds:

yaml
- tapOnPoint:
    point: "50%, 80%"
    longPress: true
    duration: 2000

Prefer percentages

Absolute pixels differ between devices. A percentage point lands on the same place on every screen size.