Overview
The Screenshot node captures images of web pages or specific elements. It supports full-page screenshots, viewport captures, element-specific screenshots, and PDF generation with advanced masking capabilities.Actions
viewport (Default)
Capture screenshot of the current viewport (visible area).fullPage
Capture screenshot of the entire page including scrollable areas.element
Capture screenshot of a specific element.Element selector to capture. Supports variable interpolation:
${data.targetElement}Type of selector:
css, xpath, text, getByRole, etc.Array of selectors for elements to mask (blur/hide) in the screenshot. Useful for hiding sensitive data.
Page format:
A4, Letter, Legal, A3, A5, TabloidInclude background graphics in the PDF.
Use landscape orientation.
Page margins. Example:
{top: '1cm', right: '1cm', bottom: '1cm', left: '1cm'}Configuration
Action to perform:
viewport, fullPage, element, or pdfFile path to save the screenshot/PDF. If not specified, a default name is generated.Supports variable interpolation:
${data.screenshotName}.png- Relative paths are resolved from the project root
- File extension determines format (
.png,.jpg,.pdf)
If
true, errors don’t stop workflow execution.Advanced Features
Waiting
Wait for an element to appear before taking screenshot.
Timeout for waiting for selector.
Wait for URL to match pattern.
Wait for JavaScript condition to be true.
Execute waits after screenshot instead of before.
Retry Logic
Enable automatic retry on failure.
Number of retry attempts.
Delay between retries in milliseconds.
Outputs
The screenshot path is stored in the context:- Variable:
screenshotPath - Type: string
- Value: Full path to the saved screenshot file
Examples
Basic Screenshots
With Masking
PDF Generation
Dynamic Naming
With Wait Conditions
Advanced Usage
Complete Example
File Formats
Image Formats
- PNG (default): Lossless, supports transparency
- JPEG: Compressed, smaller file size
PDF Options
| Format | Size (mm) | Use Case |
|---|---|---|
| A4 | 210 x 297 | Standard documents |
| Letter | 216 x 279 | US standard |
| Legal | 216 x 356 | Legal documents |
| A3 | 297 x 420 | Large documents |
| Tabloid | 279 x 432 | Presentations |
Accessing Screenshot Path
Notes
Full-page screenshots capture content beyond the viewport by scrolling. This works for most pages but may have issues with infinite scroll or lazy-loaded content.
PDF generation is only supported in Chromium-based browsers. It will fail with Firefox or WebKit.
Best Practices
Common Patterns
Screenshot on Error
Before/After Comparison
Related Nodes
- Wait - Wait before screenshots
- Navigate - Navigate to pages
- Verify Element - Verify before capture
- API Request - Upload screenshots
