Skip to main content

mobium wait

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Wait for an element to appear, disappear, show text, or reach a state

Wait until the screen says what you are waiting for, instead of sleeping and hoping. On success the screen is remapped, so the element already has a ref.

Usage​

mobium wait <@ref | locator> [flags]

Flags​

FlagTypeDefaultWhat it does
--countintWait until the locator matches this many elements (--for count)
--exactboolWith --for text, match the whole text rather than a part
--forstringCondition: visible (default), hidden, text, value, enabled, disabled, checked, unchecked, focused, or count
--notboolWait for the opposite: --for text --not waits for the text to change
--textstringText to wait for, with --for text; the whole value, with --for value
--timeoutduration10sHow long to wait before failing

And the global flags.

Examples​

Wait for text to appear​

mobium wait "text=Welcome back"

Wait for a spinner to go​

mobium wait role=progressbar --for hidden

Wait for a checkbox to be checked, for up to five seconds​

mobium wait testid=termsCheck --for checked --timeout 5s

Printed on an Android 15 emulator:

testid=termsCheck is checked after 18ms — @e3 Accept terms (checkbox, checked)

More, from mobium wait --help​

mobium wait text="Welcome back" # wait for it to appear
mobium wait role=progressbar --for hidden # wait for a spinner to go
mobium wait @e4 --for text --text "Sent" # wait for its text to change
mobium wait testid=terms --for checked # a checkbox, radio or switch
mobium wait testid=search --for value --text "" # the field is empty
mobium wait @e4 --for text --text Sending --not # until it changes
mobium wait testid=row --count 3 # three rows on screen
mobium wait text=Done --timeout 30s

On a device​

mobium wait testid=loginError --for text --text &#39;Incorrect username or password.&#39; on an Android 15 emulator

mobium wait testid=loginError --for text --text 'Incorrect username or password.' on an Android 15 emulator

The tool​

wait calls app_wait_for; its arguments and what every client calls it are there.