Skip to main content

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

  1. Use appropriate formats: PNG for quality, JPEG for smaller file sizes
  2. Set reasonable timeouts: Don’t wait too long for slow pages
  3. Use batch operations: Process multiple screenshots together
  4. Cache results: Avoid redundant screenshots of static content

Viewport Strategy

Monitoring & Logging

Common Use Cases

Visual Regression Testing

Documentation Generation

Performance Monitoring