Fill Field
Fill Field
Section titled “Fill Field”Type: page-fill · Package: Browser v1.0.9
Clears an input field (input or textarea) and writes the given value in one go. It’s the fast, recommended way to fill out forms: it sets the value directly, without simulating key presses.
How it works
Section titled “How it works”It locates the field by its selector, waits until it’s visible, enabled and editable, clears whatever it had and sets the new value. It fires the field’s input event, but not individual keyboard events (it’s almost instant). If a page needs to react to each key (autocomplete, masks that validate as you type), use Type Text instead.
- Works with
<input>,<textarea>and editable elements (contenteditable). For<select>lists use Select Option; for checkboxes, Check / Uncheck. - An empty
valueleaves the field empty: useful to clear it. - Accepts a credential in
value: it writes its value without it appearing in the playbook or the log (the log only says which field was filled).
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
selector | selector | — | The input field to fill. |
value | string | credential | — | The text to write. Supports expressions (e.g. cliente["nombre"]) and credentials. |
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”This activity does not return a value.
Example
Section titled “Example”Page Fill selector = (#usuario) value = credential("portal")["user"]Page Fill selector = (#clave) value = credential("portal")["password"]Page Fill selector = (#buscar) value = "invoice 2026"Page Click selector = (#btnBuscar)Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Fill failed: Timeout 30000ms exceeded. … | matches: 0 (…) | It didn’t find the field. Check the selector or wait first with Wait For. |
Fill failed: … | matches: 1 (the element exists but the action did not complete: …) | The field is hidden, disabled or read-only. Wait for it to be enabled. |
Fill failed: Error: Element is not an <input>, <textarea> … | The selector points to a container or to the label, not to the field. Capture the input. |
'page' must be a ZoanPageSession. | page is empty outside a body. |
Related activities
Section titled “Related activities”- Type Text — type key by key.
- Get Value — read the current value of a field.
- Select Option — choose from a drop-down list.