Fill Form
AI-generatedSummary
Fills one or more form fields on the current page of a remote Playwright browser session, using literal values or stored credential username/password, and optionally clicks a submit element.
Inputs
- Fields (required) — List of fields to fill. Each has a Selector (CSS, or XPath if it starts with / or ( ), a Value Source (Literal or Credential), and either a Value or a Credential Field (Username/Password). Entries with a blank selector are ignored; at least one field with a selector is required. Only the first element matching each selector is filled.
- Submit Form — If enabled, clicks the Submit Selector element after all fields are filled. Default false.
- Submit Selector — CSS or XPath of the element to click. Required when Submit Form is on. XPath is auto-detected from a leading / or (.
- Browser — Firefox or Chrome (chromium) browser type used to connect to the remote endpoint. Default firefox.
- Browser Endpoint — Remote browser WebSocket endpoint, e.g. ws://playwright:3000. If empty, reuses the endpoint of an existing session or the previous Playwright node. An error is thrown if none can be found.
- Leave Session Open — Keep the browser session alive for later Playwright nodes. Default true. If off, the session is closed after this operation.
- Browser Connection Options — Optional Timeout (connection ms, default 30000), Ignore SSL Issues, and Session ID. The Session ID is needed if the previous node is not a Playwright node. Otherwise the session is inherited from the previous node's output.
Output shape
One item per input item with JSON: success, filledFieldsCount, fields (array of selectorType, selector, valueSource, and credentialField when used; filled values are not echoed), submitted (boolean), submittedWith (selectorType and selector, if submitted), and url (the page URL after the action). A playwright object with sessionKey and browserEndpoint is added for chaining.
Credential-sourced values use the 'playwrightBasicAuthApi' credential and fail if the chosen field is empty. Fields are filled in order, and any failure (e.g. a selector not found) stops the item with an error unless Continue On Fail is set, in which case an item with the error message and sessionKey is returned. Clicking submit does not wait for navigation, so the returned url may be the pre-navigation page.
Examples
Example 1: Log in to a site using stored credentials and submit.
Fields: #username → Credential/Username; #password → Credential/Password. Submit Form on, Submit Selector //button[@type="submit"]. Browser Endpoint ws://playwright:3000.
Example 2: Fill a contact form but submit later after a manual check.
Fields: #name and #email with literal values (can be expressions from input data). Submit Form off. Leave Session Open on; follow with a Click Element node.