Endpoint

Overview

Saves a screen: what an app shows at one point, described by conditions on a screenshot. Wait For Screen and Check Screen nodes use it.

Request Body

string
required
A name for the screen. Up to 120 characters.
string
required
The app id (Android package or iPhone bundle id).
string
required
android or ios.
object
required
What the screen shows. It is recognised when every all condition holds and no none condition does; it needs at least one condition.
object[]
Conditions that must all hold.
string
required
text (words read on screen), label (an element the detector names) or color (the colour of an area, e.g. whether a toggle is on). vision (a yes/no question) is not available yet and is refused.
string
For text: the words to find. A line that contains them matches, or only the whole line with exact.
boolean
For text: match the whole line only.
string
For label: the detector label to find.
number[]
For text, label and color: where on the screen, as [x0, y0, x1, y1] fractions of the screenshot (0 to 1).
string
For vision: the question. A screen with a vision condition is refused: no run can decide one yet.
string
For color: the colour as #rrggbb. The condition holds when at least share of the pixels in the area are within tolerance of it. The area is the box of the first element with label (inside region when given; the condition does not hold when there is none), else region; one of them is required. Example: TikTok’s liked heart is {"kind": "color", "label": "like", "region": [0.82, 0.3, 1, 0.75], "color": "#fe2c55"}.
integer
For color: how far each of R, G and B may be from the colour, 0 to 255. Default 40.
number
For color: the share of the area’s pixels that must have the colour, above 0 up to 1. Default 0.1.
object[]
Conditions none of which may hold.
string
required
text (words read on screen), label (an element the detector names) or color (the colour of an area, e.g. whether a toggle is on). vision (a yes/no question) is not available yet and is refused.
string
For text: the words to find. A line that contains them matches, or only the whole line with exact.
boolean
For text: match the whole line only.
string
For label: the detector label to find.
number[]
For text, label and color: where on the screen, as [x0, y0, x1, y1] fractions of the screenshot (0 to 1).
string
For vision: the question. A screen with a vision condition is refused: no run can decide one yet.
string
For color: the colour as #rrggbb. The condition holds when at least share of the pixels in the area are within tolerance of it. The area is the box of the first element with label (inside region when given; the condition does not hold when there is none), else region; one of them is required. Example: TikTok’s liked heart is {"kind": "color", "label": "like", "region": [0.82, 0.3, 1, 0.75], "color": "#fe2c55"}.
integer
For color: how far each of R, G and B may be from the colour, 0 to 255. Default 40.
number
For color: the share of the area’s pixels that must have the colour, above 0 up to 1. Default 0.1.
string | null
A link to a screenshot of the screen, for reference.

Response

boolean
true when the request succeeded.
Screen
The new Screen.

Errors