Playwright Click Element Tool icon

Playwright Click Element Tool

Clicks an element on the page

Overview

This node, named "Playwright Click Element Tool," is designed to automate clicking an element on a web page within an existing browser session. It leverages a browser automation framework to perform clicks either by specifying a CSS selector or by providing exact x and y coordinates on the page.

Common scenarios where this node is useful include:

  • Automating user interactions in web testing workflows.
  • Triggering UI elements during data scraping or form submissions.
  • Simulating clicks in automated browser sessions for RPA (Robotic Process Automation).

For example, you might use this node to click a "Submit" button identified by its CSS selector or click at specific screen coordinates when selectors are not reliable.

Properties

Name Meaning
Session ID ID of the browser session to use. This identifies which active browser session to control.

Output

The node outputs a JSON object with the following structure:

{
  "success": boolean,
  "message": string
}
  • success: Indicates whether the click action was successful (true) or failed (false).
  • message: Provides a descriptive message about the result, such as confirmation of success or details about any error encountered.

The node does not output binary data.

Dependencies

  • Requires an active browser session identified by the provided Session ID.
  • Needs an API authentication credential for the underlying browser automation service.
  • Depends on an external operation function that performs the actual click action using the browser automation framework.

Troubleshooting

  • Error: "Either provide a selector OR both x and y coordinates"
    This occurs if neither a CSS selector nor both x and y coordinates are provided. To fix, supply either a valid CSS selector or both numeric x and y coordinates.

  • Error: "Cannot provide both selector and coordinates"
    This happens if both a selector and coordinates are given simultaneously. Provide only one method to specify the click target.

  • Failure to click element due to session issues
    Ensure the Session ID corresponds to an active and valid browser session. If the session has expired or is invalid, the click will fail.

  • Authentication errors
    Verify that the required API authentication token or credentials are correctly configured in n8n.

Links and References

Discussion