Actions10
Overview
The node provides automation capabilities using the Playwright API, specifically allowing interaction with browser sessions. The "Click Element" operation within the "Session" resource enables users to simulate mouse clicks on web page elements inside an active browser session. This can be done either by specifying a CSS selector for the element or by clicking at specific screen coordinates.
This operation is useful in scenarios such as automated UI testing, web scraping workflows where interaction with page elements is required, or automating repetitive tasks on websites (e.g., clicking buttons, links, or other interactive elements).
Example use cases:
- Clicking a "Submit" button on a form after filling it out.
- Interacting with dynamic menus or pop-ups by clicking specific elements.
- Automating navigation through a multi-step web process that requires user clicks.
Properties
| Name | Meaning |
|---|---|
| Session ID | ID of the browser session to use for the click action. |
| Click Type | Method to perform the click: either by "Selector" (CSS selector) or by "Coordinates". |
| Element Selector | CSS selector string identifying the element to click (required if Click Type is "Selector"). |
| X Coordinate | X coordinate on the page to click (required if Click Type is "Coordinates"). |
| Y Coordinate | Y coordinate on the page to click (required if Click Type is "Coordinates"). |
Output
The node outputs JSON data representing the result of the click operation. Typically, this will confirm success or provide any relevant response from the Playwright API regarding the click action.
If the operation fails, the output may contain an error message describing what went wrong.
No binary data output is associated with the "Click Element" operation.
Dependencies
- Requires a valid and active browser session identified by the Session ID.
- Requires authentication via an API key credential configured in n8n to access the Playwright API.
- The Playwright environment must be properly set up and accessible by the node.
Troubleshooting
Common issues:
- Invalid or expired Session ID: Ensure the session exists and is active before attempting to click.
- Incorrect CSS selector: If using "Selector" click type, verify the selector matches an element on the page.
- Coordinates outside viewport: When using coordinates, ensure the X and Y values are within the visible page area.
- Network or API errors: Check API credentials and network connectivity.
Error messages:
"The operation \"clickElement\" is not supported!"— indicates an unsupported operation was requested; verify operation name.- Errors related to element not found or timeout when clicking by selector usually mean the selector is incorrect or the page hasn't fully loaded.
- Permission or authentication errors suggest issues with the API key or session authorization.
Resolving these typically involves verifying input parameters, ensuring the session is active, and confirming correct API credentials.