Variables
Capture a value from the screen with Store, or assign one with SET. The four right-hand sides SET accepts, and what it rejects.
Store captures what's on the screen. SET assigns a value already available to the script. Both last for one test run.
Platforms
Android · iOS
SET right-hand sides
{{variable.path}} · API.<name>.… · screen(...)
Reference later as
{{var}}, and {{var.field}} for a screen(...) object
Watch out
Writing the same name twice overwrites the first value, permanently
Prerequisites
A test open in the desktop app editor
The value visible on screen, for
Storeandscreen(...)An API registered under
<name>, forSET <var> = API.<name>.…
The mechanism
Assigns a value the script already has.
SET city = "Bangalore"
SET total = {{order.amount}}
SET cart = API.shopease_cart.response
SET item_count = API.shopease_cart.response.items.length
SET promo = screen(the promo banner headline on the home screen)Use for: a value fixed for this test, a value from an API step, or several related fields captured as one object.
SET accepts exactly four kinds of right-hand side. Anything else fails the step with an explicit error.
1
A literal
SET city = "Bangalore" · SET qty = 3 · SET body = { "key": "value" }
The value is fixed for this test
2
Another variable
SET total = {{order.amount}}
The value is already in a variable
3
An API reference
SET cart = API.shopease_cart.response · .request · .status_code · plus any dotted path
The value comes from an API step
4
A screen(...) read
SET promo = screen(the promo banner headline)
Several related fields are needed as one object
SET accepts AI expressions.
SET random_city = ai(pick a random city in India).SET … = screen(...)
screen(...) returns an object indexable field by field, unlike Store, which returns one value.
A screen(...) read takes three parts:
Surface description
Names the region of the screen to read
the product detail card
format={…}
The keys to return. [] marks a list-valued key
format={item_count: "", total: "", items: []}
Key hint
Disambiguates any key whose meaning isn't obvious
price is the amount including the currency symbol
Overwrites are permanent
Variables are a single key/value store. Writing the same name twice replaces the first value, and the original is gone.
Using and validating a stored value
Reference a stored value anywhere a value goes:
And validate it:
Numeric comparisons do real arithmetic — greater than, less than, equals … plus …. Directional comparisons survive price and tax changes; an exact expected number does not.
A failed SET may not stop the test
A SET step that fails to evaluate can report as passed. The run continues with the variable unset, and later steps act on an empty value.
To catch it, add a validation after any SET the rest of the test depends on:
Write the
SETstep.Validate one field of the result on the next line.
Run the test and confirm the failure now lands on the
SET, not three steps later.
Common mistakes
Validate that order_id is visible
Looks for the literal text order_id on screen. Write {{order_id}}
Store the order ID as id when it's only in the backend
Vision AI reads pixels. It can't see values the app doesn't render
Store the price as p then Type p in the search field
Types the letter p. Reference it as {{p}}
Storing a value that's scrolled off-screen
Nothing to read. Scroll to it first
Next
Last updated: 6 August 2026
Last updated
Was this helpful?