Actions10
Press
AI-generatedOverview
This node allows direct control of a Chromium browser instance using the Playwright library connected via a Chrome DevTools Protocol (CDP) URL. It enables automation of browser actions such as clicking elements, filling inputs, typing text, pressing keys, navigating to URLs, taking screenshots, and waiting for certain page states or selectors.
Common scenarios include:
- Automating form submissions by filling inputs and clicking buttons.
- Navigating to web pages and capturing screenshots for monitoring or testing.
- Simulating user keyboard interactions on specific elements.
- Waiting for page load events or specific elements before proceeding with further automation steps.
For example, you could use this node to automate logging into a website by navigating to the login page, filling username and password fields, pressing Enter on the password input, and then taking a screenshot of the logged-in homepage.
Properties
| Name | Meaning |
|---|---|
| CDP URL | Chrome DevTools Protocol URL to connect to the browser (e.g., ws://localhost:9222/...) |
| Selector | Playwright selector of the element to interact with (CSS selector or other supported syntax) |
| Key | Keyboard key to press on the selected element (e.g., "Enter", "Tab") |
Note: These properties are relevant when the operation is Press. The node supports many other operations with additional properties not listed here.
Output
The node outputs an array of items corresponding to each input item processed. Each output item contains a json field with at least the following structure:
{
"operation": "press"
}
This indicates which operation was performed.
No additional data is returned for the Press operation beyond confirming the action.
If other operations like Screenshot are used, the node outputs binary data containing the image under the binary field named screenshot.
Dependencies
- Requires a running Chromium browser instance accessible via a Chrome DevTools Protocol WebSocket URL.
- Uses the Playwright library to connect and control the browser.
- No internal credential types are exposed; users must provide the CDP URL manually.
- No additional environment variables or n8n credentials are required beyond the CDP URL.
Troubleshooting
- Connection issues: If the node cannot connect to the provided CDP URL, ensure that the Chromium instance is running with remote debugging enabled and the URL is correct.
- Selector errors: If the selector does not match any element, the operation may fail or timeout. Verify the selector syntax and presence of the element on the page.
- Unsupported key: Pressing a key not recognized by Playwright may cause errors. Use standard keyboard key names.
- Timeouts: Operations waiting for selectors or load states may time out if the page is slow or the element never appears. Adjust timeout values accordingly.
- Operation errors: Using an unsupported operation value will throw an error indicating the operation is unsupported.