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.
| Parameter | Type | Description |
|---|---|---|
point | String | "x, y" in absolute pixels ("100, 200") or percent of the screen ("50%, 50%"). When set, it replaces x and y. |
x | Integer | Absolute x coordinate. |
y | Integer | Absolute y coordinate. |
longPress | Boolean | If true, press and hold instead of tapping. |
duration | Integer | Hold 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: 640Press and hold for 2 seconds:
yaml
- tapOnPoint:
point: "50%, 80%"
longPress: true
duration: 2000Prefer percentages
Absolute pixels differ between devices. A percentage point lands on the same place on every screen size.
