Skip to content

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.

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 the value of 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.
ParameterTypeDefaultDescription
selectorselector—The input/select/textarea field to read.
ParameterTypeDefaultDescription
pageZoanPageSession—The page session. Omit it inside a body; outside, pass the session variable (e.g. page = page).
timeoutnumber30000Maximum time in ms to wait for the element. Empty, 0 or negative: the project settings value or, if none, 30000.

Returns a string with the field’s value; "" if the field is empty.

Page Fill selector = (#cantidad) value = "10"
Page Get Value selector = (#cantidad) → output: cantidadActual
If condition = cantidadActual != "10"
└─ then:
Throw message = "The field didn't accept the expected value"
MessageCause and fix
Error: Node is not an <input>, <textarea> or <select> elementThe selector points to another element (a label, a container). Capture the field, or use Get Text if you want the visible text.
Timeout 30000ms exceededThe 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.
  • Get Text — visible text of elements that aren’t fields.
  • Fill Field — write a value into the field.