Overview
This node, named "Playwright Screenshot Tool," captures a screenshot of the current page in an existing browser session managed by Playwright. It is designed to be used in automation workflows where visual verification or archival of web pages is needed. For example, it can be used to monitor website changes, capture snapshots for reports, or debug UI issues by saving screenshots at specific points in a workflow.
Properties
Name | Meaning |
---|---|
Session ID | ID of the browser session to use. This identifies which active Playwright browser session the screenshot will be taken from. |
Output
The node outputs JSON data containing the screenshot image as binary data. The structure includes:
success
: A boolean indicating if the screenshot was successfully taken.binary
: An object with a key (default"data"
or a custom name if specified) holding the screenshot file details:data
: The raw image data.mimeType
: Always"image/png"
.fileName
: A timestamped filename like"screenshot-<timestamp>.png"
.fileExtension
:"png"
.
message
: A success message string.
This output allows subsequent nodes to access the screenshot image either for storage, further processing, or sending via other services.
Dependencies
- Requires an active Playwright browser session identified by the provided Session ID.
- Needs an API authentication credential to connect to the Playwright service.
- Relies on internal Playwright operations to perform the screenshot capture.
Troubleshooting
Common Issues:
- Invalid or expired Session ID: The node will fail if the session does not exist or has been closed.
- Missing or incorrect API credentials: Without proper authentication, the screenshot cannot be taken.
- Network or service errors when communicating with the Playwright backend.
Error Messages:
"Failed to take screenshot: <error message>"
indicates that the screenshot operation failed. Check the session validity and API credentials.
Resolutions:
- Verify the Session ID corresponds to an active Playwright session.
- Ensure the API authentication token or credential is correctly configured and valid.
- Confirm network connectivity to the Playwright service endpoint.
Links and References
- Playwright Official Documentation
- n8n documentation on Using Credentials