Playwright API icon

Playwright API

Interact with Playwright API

Overview

The node provides an interface to interact with browser sessions using the Playwright API. Specifically, the "Press Key" operation allows you to simulate pressing a keyboard key within an active browser session. This is useful for automating web interactions that require keyboard input, such as submitting forms by pressing "Enter", navigating through fields with "Tab", or triggering shortcuts.

Common scenarios include:

  • Automating form submissions by pressing "Enter".
  • Navigating through interactive elements on a page using arrow keys.
  • Triggering keyboard shortcuts in web applications.
  • Testing keyboard accessibility features.

Properties

Name Meaning
Session ID The identifier of the active browser session where the key press will be simulated.
Key Press The specific keyboard key to press, e.g., "Enter", "Tab", "ArrowLeft", "a", "1", etc.

Output

The node outputs JSON data representing the result of the key press action within the specified browser session. The exact structure depends on the underlying Playwright API response but generally confirms the success or failure of the key press event.

No binary data output is associated with this operation.

Dependencies

  • Requires a valid and authenticated connection to the Playwright API via an API key credential configured in n8n.
  • The node depends on an active browser session identified by the provided Session ID.

Troubleshooting

  • Common issues:

    • Using an invalid or expired Session ID will cause the operation to fail because the session no longer exists.
    • Providing an unsupported or misspelled key name may result in errors or no action.
    • Network or authentication issues with the Playwright API can prevent the operation from completing.
  • Error messages:

    • "The operation "press" is not supported!" — indicates an incorrect operation parameter; ensure "Press Key" is selected.
    • Errors related to session not found or invalid session ID — verify the session ID is correct and the session is active.
    • Authentication errors — check that the API key credential is properly set up and has necessary permissions.

Links and References

Discussion