fill_form
Fill web form fields using CSS selectors, field names, or label text, then optionally submit. Works across modals and div-based UIs without requiring a boundary.
Instructions
Fill one or more form fields with values and optionally submit the form. Accepts field identifiers as CSS selectors, field names/IDs, or @eN references from page_map. Also resolves fields by visible label text page-wide — works in modals and div-based UIs without a boundary. Returns post-action page_state with the resulting URL and structural diff. Use form_selector to disambiguate when the page contains multiple forms.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| widen | No | When true, return the full-page diff instead of scoping to the interacted container. Default: false. | |
| fields | Yes | Map of field identifiers to values. Keys can be CSS selectors ("input[name='email']"), field name/ID attributes ("email"), or @eN refs from page_map ("@e5"). Values are the text to type into each field. | |
| submit | No | If true, submit the form after filling all fields (triggers form submission event). Default: false. | |
| form_selector | No | CSS selector or @eN ref targeting a specific <form> element. Required when the page has multiple forms to disambiguate which form to fill. |