Overview
BrowserTest SDK provides powerful screenshot capabilities with multiple capture modes and customization options.Basic Screenshot
The simplest way to capture a screenshot:Screenshot Options
Full Page Screenshots
Capture the entire page, not just the viewport:Custom Viewport
Control the browser viewport size:Image Formats & Quality
Choose between PNG and JPEG formats:Element-Specific Screenshots
Capture only a specific element on the page:Timing & Wait Conditions
Control when the screenshot is taken:Advanced Options
Convenience Methods
BrowserTest provides convenient methods for common screenshot types:Full Page Shortcut
Element Shortcut
Batch Screenshots
Process multiple screenshots efficiently:Batch with Individual Options
Error Handling
Handle screenshot failures gracefully:Response Format
All screenshot methods return a consistent response:Best Practices
Performance Optimization
- Use appropriate formats: PNG for quality, JPEG for smaller file sizes
- Set reasonable timeouts: Don’t wait too long for slow pages
- Use batch operations: Process multiple screenshots together
- Cache results: Avoid redundant screenshots of static content
