expect_state
Confirm that a visible UI element's readable state property, such as checked or enabled, equals an expected value. Returns structured success or failure.
Instructions
Purpose: Verify a readable UI state property on the currently visible element.
Inputs:
selector or element_id
property
expected
platform/deviceId (optional)
Supported properties:
checked, selected, focused, expanded, enabled, text_value, value, raw_value
Verification Guidance:
Use this when the UI element is visible but its state must also be confirmed
Prefer the canonical property names above
The tool compares the normalized readable state and returns the observed value when available
Constraints:
Returns structured success/failure only
Does not infer a state when the property is unavailable
Failure Handling:
ELEMENT_NOT_FOUND → re-resolve the element or wait for UI stabilization
UNKNOWN → capture a snapshot and stop
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deviceId | No | Optional device serial/udid | |
| expected | Yes | Expected normalized state value. | |
| platform | No | Optional platform override | |
| property | Yes | Readable state property to verify. | |
| selector | No | ||
| element_id | No | Optional previously resolved element identifier. |