Playwright icon

Playwright

Automate browser actions using Playwright

Overview

This node automates browser interactions using the Playwright library. It allows users to perform various browser operations such as navigating to URLs, clicking elements, filling form fields, taking screenshots, extracting text, and running custom Playwright scripts.

The Fill Form operation specifically enables filling a form field identified by a CSS selector with a specified value on a given webpage URL. This is useful for automating data entry tasks, testing web forms, or pre-filling information before further automated steps.

Practical examples:

  • Automatically fill login credentials into a website's login form.
  • Populate search fields on a webpage before triggering a search.
  • Enter data into multi-step forms during automated testing or data scraping workflows.

Properties

Name Meaning
URL The webpage URL to navigate to before filling the form field.
Selector CSS selector identifying the form field element to fill.
Value The string value to input into the selected form field.
Browser The browser engine to use for automation. Options: Chromium, Firefox, Webkit.
Browser Launch Options Options controlling browser launch behavior:
- Headless: Run browser without UI (true/false).
- Slow Motion: Delay in milliseconds to slow down operations.

Output

The node outputs an array of JSON objects corresponding to each input item processed. For the Fill Form operation, the output JSON typically contains the result of the form filling action, which may be minimal or empty since the main effect is side-effect on the webpage.

If an error occurs and "Continue On Fail" is enabled, the output JSON will include an error field describing the issue along with metadata like the browser type and operating system platform.

No binary data output is produced by this operation.

Dependencies

  • Requires the Playwright library installed in the environment.
  • Downloads and installs browser binaries if not already present.
  • No explicit API keys or external service credentials are needed.
  • Node.js environment must support dynamic imports and file system access for browser management.

Troubleshooting

  • Browser executable path errors: If the node cannot find the browser executable, it attempts to install the required browser automatically. Ensure the environment has internet access and permissions to download and save files.
  • Timeouts or navigation failures: Network issues or incorrect URLs can cause page load failures. Verify the URL is correct and accessible.
  • Selector not found: If the CSS selector does not match any element on the page, the fill operation will fail. Double-check the selector syntax and page content.
  • Headless mode issues: Some websites behave differently in headless mode. Try disabling headless mode via the Browser Launch Options to debug visually.
  • Error messages: Errors thrown during execution include descriptive messages. Enabling "Continue On Fail" allows workflow continuation with error details in output.

Links and References

Discussion