Overview
This node, named "Playwright Key Press Tool," is designed to simulate pressing a keyboard key within an existing browser session controlled by Playwright. It is useful in automation workflows where interaction with web pages via keyboard input is required, such as submitting forms, navigating through UI elements, or triggering keyboard shortcuts.
Practical examples include:
- Automating form submissions by pressing the "Enter" key.
- Navigating through a webpage using arrow keys.
- Triggering specific actions on a page that respond to key presses like "Tab" or function keys.
Properties
Name | Meaning |
---|---|
Session ID | ID of the browser session to use |
Output
The node outputs a JSON object indicating the success or failure of the key press action. The structure includes:
success
: A boolean indicating if the key press was successful.message
: A string message describing the result, e.g.,"Successfully pressed key: Enter"
.
No binary data output is produced by this node.
Example output JSON:
{
"success": true,
"message": "Successfully pressed key: Enter"
}
Dependencies
- Requires an active Playwright browser session identified by the provided Session ID.
- Needs an API authentication credential for Playwright service access.
- Relies on internal Playwright operations to perform the key press action.
Troubleshooting
Common issues:
- Invalid or expired Session ID: Ensure the session ID corresponds to an active browser session.
- Missing or invalid API credentials: Verify that the required API authentication token is correctly configured.
- Unsupported key names: Use valid key names recognized by Playwright (e.g., "Enter", "Tab", "ArrowLeft").
Error messages:
"Failed to press key: <error message>"
indicates the key press operation failed. Check the session validity and key name correctness.
Resolving these typically involves verifying session management, credential setup, and ensuring the key parameter matches expected values.