Playwright icon

Playwright

Automate browser actions using Playwright

Fill Form

AI-generated

Summary

Fill a form field on a webpage by navigating to a specified URL, selecting the target element via CSS selector or XPath, and entering the given value.

Inputs

  • URL (required) — The URL of the webpage on which the form field exists.
  • Selector Type (required) — The method to locate the target form field element: CSS Selector or XPath.
  • CSS Selector — The CSS selector string identifying the form field element, required if Selector Type is CSS Selector.
  • XPath — The XPath string identifying the form field element, required if Selector Type is XPath.
  • Value (required) — The value to fill into the form field.
  • Browser — The browser engine to use for the operation: Chromium, Firefox, or Webkit. Defaults to Chromium.
  • Browser Launch Options — Options for launching the browser, including headless mode and operation slowdown (slow motion).

Output shape

a single JSON object

The output JSON object contains a success boolean, the selector type used, the selector string, and the value filled. The output is paired with the input item index.

Examples

Example 1: Fill out an input field on a webpage

Set URL to the page containing the form, select CSS or XPath, provide the selector for the input field, and specify the value to enter.

Links

Discussion