get_text
Reads the visible text a user sees on a web element, waiting until it becomes visible and returning trimmed text. Target it by selector or ref from capture_page.
Instructions
Read the visible text of an element: what a user sees, not hidden text or an input's value. Waits for the element to be visible, then returns its text (trimmed by default). Target it by selector or by a ref from capture_page. To read an input's value or any attribute, use get_attribute; to check text as a pass/fail test step, use assert_text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Element ref from the latest capture_page result (e.g. 'e12'). Use instead of selector; refs go stale after navigation, so capture again if one is rejected. | |
| trim | No | Remove leading and trailing whitespace (default true). | |
| selector | No | How to find the element, e.g. { by: 'id', value: 'user-name' } or { by: 'css', value: '#login-button' }. Provide either selector or ref. | |
| timeoutMs | No | How long to wait for the element to become visible, in milliseconds (default 10000). |