Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Short answer: Symfony Panther can capture browser screenshots with $client->takeScreenshot(), but Symfony’s documentation describes that method as taking a screenshot of the current page, not as a guaranteed full-document capture. For content below the viewport, use Chrome DevTools Protocol (CDP) with captureBeyondViewport, or test a Panther workaround that resizes the browser to the document’s scroll dimensions before capturing.

What “full-page” means in Symfony

A normal screenshot records the rendered viewport. A full-page screenshot must also include content below (and sometimes beside) that viewport, including sections revealed by lazy loading. Those are different capture boundaries.

Panther is Symfony’s real-browser tool for end-to-end tests. It supports Chrome and Firefox through WebDriver and can run headlessly, which is useful in CI. Symfony’s End-to-End Testing documentation shows takeScreenshot() for screenshots during a test, but it does not promise that the method automatically captures the entire document.

Install Panther and a compatible driver

  1. Install Panther as a development dependency:
    composer require --dev symfony/panther
  2. Install a browser driver. Symfony documents the Browser Driver Installer package and this command:
    composer require --dev dbrekelmans/browser-driver-installer
    vendor/bin/bdi detect drivers

    You can instead install ChromeDriver or GeckoDriver with your operating system’s package manager. Keep the driver compatible with the browser version installed on the machine.

  3. Use Panther’s native browser client. BrowserKit-based alternatives are faster for HTTP tests, but they do not execute JavaScript, apply CSS, or capture screenshots.

Capture the rendered page with Panther

This is the documented baseline for a screenshot of the current browser page:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
<?php

use SymfonyComponentPantherClient;

$client = Client::createChromeClient();
$client->request('GET', 'https://example.com');
$client->takeScreenshot('screen.png');

For Firefox, replace the client creation call:

$client = Client::createFirefoxClient();

Run Chrome headlessly in CI by passing the appropriate browser arguments supported by your Panther setup. Save screenshots to a directory that exists and is writable by the test process.

Approach 1: use Chrome CDP for content beyond the viewport

Chrome DevTools Protocol exposes an explicit Page.captureScreenshot method. Its captureBeyondViewport parameter defaults to false; setting it to true tells Chrome to include content outside the visible viewport. This is a Chrome-specific route, not a Firefox command. See the Chrome DevTools Protocol Page reference for the current parameter contract.

How you invoke CDP depends on the WebDriver/CDP bridge and Panther version in your project. The important implementation requirements are:

  • Wait until the application has rendered the state you want to archive.
  • Determine the page bounds from the document, including the maximum of scrollWidth/scrollHeight and the document and body client dimensions.
  • Call Chrome’s Page.captureScreenshot with captureBeyondViewport: true and suitable clip or layout metrics.
  • Write the returned base64 image data to a file and verify the result on pages with sticky headers, lazy images, and very tall content.

Because Panther’s public guide does not provide a one-line full-page CDP helper, treat the bridge code as an integration detail of your installed Panther/WebDriver stack rather than assuming a universal method name. Pin and test the versions used by CI.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Approach 2: resize the Panther window, then call takeScreenshot()

Symfony documents that browser window dimensions control screenshot size. Chrome can be started with a large --window-size, and Firefox can be resized with a WebDriver dimension. A Panther GitHub issue reports this workaround:

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
$width = $client->executeScript(
    'return document.documentElement.scrollWidth'
);
$height = $client->executeScript(
    'return document.documentElement.scrollHeight'
);

$size = new WebDriverDimension($width, $height);
$client->manage()->window()->setSize($size);
$client->takeScreenshot('screenshot.png');

The issue author is unsure whether this works in every situation. Use it as a local experiment, not as a guaranteed Panther full-page API. Very tall pages can hit browser or image-size limits; fixed elements may appear differently after resizing; and a page that loads more content only while scrolling may still be incomplete.

Make the workaround safer

  • Wait for a stable application marker, such as a main content selector, before measuring dimensions.
  • Trigger the page’s lazy-loading behavior if your application requires scrolling.
  • Measure both document.documentElement and document.body and use the largest width and height.
  • Compare the output with a manually verified browser capture at representative production layouts.
  • Restore the original window size when subsequent tests depend on a normal viewport.

Complete PHPUnit example

The following test demonstrates navigation, a readiness wait, dimension measurement, resizing, and capture. Adjust selectors and the output directory for your application:

<?php

namespace AppTests;

use SymfonyComponentPantherPantherTestCase;
use FacebookWebDriverWebDriverDimension;

final class ScreenshotTest extends PantherTestCase
{
    public function testPageScreenshot(): void
    {
        $client = static::createPantherClient([
            'browser' => 'chrome',
        ]);

        $client->request('GET', 'https://example.com');
        $client->waitFor('#main-content');

        $width = (int) $client->executeScript(
            'return Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);'
        );
        $height = (int) $client->executeScript(
            'return Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);'
        );

        if ($width < 1 || $height < 1) {
            throw new RuntimeException('The page reported invalid dimensions.');
        }

        $client->manage()->window()->setSize(
            new WebDriverDimension($width, $height)
        );
        $client->takeScreenshot(__DIR__ . '/../../var/screenshots/page.png');
    }
}

waitFor() only proves that the selected element appeared. If your page performs additional requests, add an application-specific readiness signal or a deliberate delay, then validate that images and fonts have finished loading.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Dynamic pages, lazy loading, and layout edge cases

JavaScript-rendered content

Use Panther’s native Chrome or Firefox client. An HTTP-only client cannot produce the browser-rendered layout required for a faithful screenshot.

Lazy-loaded images

Full document dimensions do not guarantee that every image has loaded. Wait for image completion or exercise the page’s scroll behavior before capture, and inspect the output for blank placeholders.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Sticky headers and overlays

Sticky navigation, cookie banners, chat widgets, and modal dialogs can cover content. Close or hide them in the test setup, and verify whether a resized window changes their positioning.

Extremely tall documents

One enormous bitmap can exceed browser, driver, or image encoder limits. Split the page into sections, capture PDF output instead, or use a service that handles long-page rendering. Record the chosen limit in your CI configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Automatic failure screenshots are not automatically full-page

Panther’s PHPUnit extension can save screenshots for failed or errored tests when PANTHER_ERROR_SCREENSHOT_DIR is configured. Those files are valuable for debugging, but the Symfony documentation does not establish that they include the entire document. If full-page coverage matters, implement and verify an explicit capture path.

Troubleshooting

“Driver not found” or session creation fails

Install ChromeDriver or GeckoDriver, run vendor/bin/bdi detect drivers, and check browser/driver compatibility. In CI, confirm the executable is on PATH and that the runner has the required shared libraries.

The image contains only the viewport

That is the expected behavior of a basic takeScreenshot() call. Use the CDP captureBeyondViewport route or test the resize workaround.

Content is missing below the fold

Wait for the application’s ready state, trigger lazy loading, and recalculate dimensions immediately before capture. A fixed delay alone may be insufficient for slow API responses.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Chrome refuses the requested window size

Reduce the dimensions, pass a supported --window-size, or switch to CDP capture. Check whether the document is taller than your browser’s practical bitmap limit.

Firefox behaves differently

The CDP parameter described above is Chrome-specific. Use Panther’s Firefox client with a tested WebDriver resize strategy, or standardize the capture job on Chrome when exact beyond-viewport semantics are required.

CI captures differ from local runs

Fix the viewport, device scale, timezone, locale, fonts, authentication state, and network fixtures. Compare screenshots at the same browser and driver versions and avoid animations during capture.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When an API is a better fit

If installing browsers and drivers, maintaining CI images, and validating full-page edge cases is more work than the screenshot feature warrants, a screenshot API can move that responsibility out of your test runner.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ScreenshotNeo

ScreenshotNeo is a website screenshot API and MCP server. Its clean-shot workflow accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. It supports full-page captures with lazy images loaded, CSS-selector element capture, device presets, custom CSS and JavaScript, waits, request blocking, cookies and headers, caching, PDFs, bulk jobs, and async webhooks. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.

Plans include 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000 screenshots. Every feature is available on every plan.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Or skip the browser setup

Use the one-call endpoint documented at ScreenshotNeo’s API documentation:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Cookie banners, popups, and chat widgets are removed before the shot. Bot checks, blank pages, and failed loads are never billed. AI agents can take screenshots through the MCP server. You get 1,000 screenshots a month free with no card, and paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does Panther’s takeScreenshot() guarantee a full-page image?

No. Symfony documents it as a screenshot of the current page; use and test CDP or a resize-based workaround for content beyond the viewport.

Can I use Chrome’s captureBeyondViewport parameter with Firefox?

No. That parameter belongs to Chrome DevTools Protocol. Firefox requires a separately tested WebDriver strategy.

Why is my screenshot missing lazy-loaded images?

The browser may not have loaded them when capture occurred. Wait for a readiness condition and exercise the page’s lazy-loading behavior before measuring and capturing.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.