Get Value
Get Value
Section titled “Get Value”Type: page-get-value · Package: Browser v1.0.9 · Output: string
Reads the value of a form field —an <input>, <select> or <textarea>— and returns it as text. Use it to check what’s written in a field, read a pre-filled value, or confirm what the bot just wrote.
How it works
Section titled “How it works”It locates the field by its selector, waits for it to exist (up to timeout) and returns its value property (what the field holds right now), which is not always the same as its visible text.
- In a
<select>, it returns thevalueof the selected option (not its visible text). In a<select multiple>, that of the first selected one. - The value isn’t written to the log: the log only says which field it was read from.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
selector | selector | — | The input/select/textarea field to read. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
page | ZoanPageSession | — | The page session. Omit it inside a body; outside, pass the session variable (e.g. page = page). |
timeout | number | 30000 | Maximum time in ms to wait for the element. Empty, 0 or negative: the project settings value or, if none, 30000. |
Output
Section titled “Output”Returns a string with the field’s value; "" if the field is empty.
Example
Section titled “Example”Page Fill selector = (#cantidad) value = "10"Page Get Value selector = (#cantidad) → output: cantidadActualIf condition = cantidadActual != "10" └─ then: Throw message = "The field didn't accept the expected value"Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Error: Node is not an <input>, <textarea> or <select> element | The selector points to another element (a label, a container). Capture the field, or use Get Text if you want the visible text. |
Timeout 30000ms exceeded | The field didn’t appear in time. Check the selector or wait first with Wait For. |
'page' must be a ZoanPageSession. | page is empty outside a body. |
Related activities
Section titled “Related activities”- Get Text — visible text of elements that aren’t fields.
- Fill Field — write a value into the field.