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

For a full-page screenshot in Selenium Java, the most direct documented route is FirefoxDriver with Selenium’s HasFullPageScreenshot interface. The standard WebDriver screenshot call captures the current browsing context, not a guaranteed entire document. On Windows, save the returned image to a writable path, then check the result for lazy-loaded content, clipping, and nested scroll areas.

Use FirefoxDriver for Selenium’s documented full-page screenshot API

Selenium’s Java API exposes getFullPageScreenshotAs(OutputType<X>) through HasFullPageScreenshot, and lists FirefoxDriver as an implementing class. The API does not establish how every page-specific behavior—such as lazy loading or nested scrolling—will appear, so inspect the output for the page you need to capture.

The example below shows the capture and Windows file-output steps. Add Selenium Java and a compatible Firefox setup to your project before running it. The exact dependency and browser-driver setup depends on your project and Selenium version; the cited API does not prescribe a Windows installation procedure.

import org.openqa.selenium.OutputType;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.HasFullPageScreenshot;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

public class FullPageScreenshot {
    public static void main(String[] args) throws IOException {
        Path destination = Paths.get("C:\screenshots\page.png");
        Files.createDirectories(destination.getParent());

        FirefoxDriver driver = new FirefoxDriver();
        try {
            driver.get("https://example.com");

            HasFullPageScreenshot fullPage = driver;
            File screenshot = fullPage.getFullPageScreenshotAs(OutputType.FILE);
            Files.copy(screenshot.toPath(), destination,
                    StandardCopyOption.REPLACE_EXISTING);

            System.out.println("Saved screenshot to " + destination.toAbsolutePath());
        } finally {
            driver.quit();
        }
    }
}

Replace https://example.com with the page to capture. The Java string uses escaped backslashes for the Windows path. Creating the parent directory prevents a missing-folder failure, and the finally block closes the browser even if navigation or saving fails.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
LAPGEAR Home Office Pro Lap Desk - Black Carbon, Fits 15.6” Laptops
  • Spacious Design: Measuring 21.1" wide and 14.1" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
  • Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy ergonomic support with the integrated cushioned wrist rest.
  • Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
  • Durable Surface: Work with confidence on our lap desk's solid surface, featuring a sleek black carbon color, ensuring optimal air circulation to prevent your laptop from overheating.
  • On-the-Go Convenience: With an integrated handle and lightweight design (2.8 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.

Prepare the page and validate the entire-page result

  1. Wait for the page state you need. Navigate, then wait for important content to appear. If the page loads images or sections only as they approach the viewport, scroll through the relevant area or use page-specific waits before capturing; the API documentation does not promise that lazy content is loaded automatically.
  2. Capture to an absolute path. Ensure the destination folder exists and the Windows account running Java can write to it.
  3. Inspect the image. Check the bottom of the document, fixed or sticky headers, and content in nested scrolling regions. A full-page capture capability does not by itself establish how those page features will be represented.
  4. Close the driver. Keep browser cleanup in a finally block or equivalent so failures do not leave the browser process running.

Firefox, Chrome, and the ordinary screenshot call

Route Full-page support established by the cited API Java compatibility Practical consideration
FirefoxDriver with HasFullPageScreenshot Yes; Selenium documents getFullPageScreenshotAs(OutputType<X>) and lists FirefoxDriver as an implementation. Use the Selenium Java API available in the project. Save the returned file and verify lazy content, sticky elements, and nested scrolling on the target page.
Chrome DevTools Protocol Page.captureScreenshot includes captureBeyondViewport; its documented default is false. The Selenium generated Java DevTools APIs are tied to protocol versions. Confirm a compatible binding for the Chrome and Selenium versions in use. The protocol option is documented, but the specific current Java binding and package are not established here. Check the project’s dependencies rather than copying an older package name.
Ordinary WebDriver screenshot No general full-document guarantee; Selenium describes capturing the current browsing context. The normal Selenium Java screenshot flow can save its output to a file. Use for a viewport screenshot, not as proof that the entire document was captured.

Chrome: what to check before using beyond-viewport capture

Chrome DevTools Protocol documents captureBeyondViewport for Page.captureScreenshot, with a default value of false. That protocol capability is separate from the Java API exposed by the Selenium version in your project. Before implementing this route, check the generated DevTools binding and protocol version that match your Chrome and Selenium releases. The available documentation does not establish a current Java code sample or version matrix, so a package name copied from an older example may not work.

Common problems and fixes

  • The image stops at the viewport: You may be using the ordinary WebDriver screenshot endpoint. Use Firefox’s explicit full-page interface, or a verified Chrome DevTools route with beyond-viewport capture configured.
  • The destination file cannot be written: Confirm the Windows path is correct, the parent directory exists, and the Java process has write access. The sample creates the directory before copying the screenshot.
  • Images or sections are missing: The full-page API documentation does not guarantee lazy-loaded content. Trigger the page’s loading behavior and wait for the needed elements before capture, then inspect the image.
  • Chrome DevTools classes or methods are unavailable: Check the protocol version and generated Selenium DevTools binding against the browser and Selenium versions in the project. Do not assume an old package name matches a current setup.
  • Content inside a panel is absent or clipped: Nested scroll-container behavior is not specified by the cited full-page API. Validate the target page and determine whether its inner panel needs separate handling.
  • The browser remains open after an exception: Put driver.quit() in a finally block so cleanup runs when capture or file output fails.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo takes a screenshot or PDF through a single GET request, and also provides an MCP server for AI agents. Before capture, it accepts consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, with the response indicating the page verdict and billing status.

Example cURL request for a WebP screenshot (replace the URL with the page you want to capture):

Rank #2
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.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for setup and request options. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for free.

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.
Best Value
Sale
LAPGEAR Home Office Lap Desk – Pink, Fits 15.6” Laptops
  • Spacious Design: Measuring 21.1" wide and 12" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
  • Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy laptop support with the integrated device ledge.
  • Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
  • Durable Surface: Work with confidence on our lap desk's solid surface, featuring a blush pink color, ensuring optimal air circulation to prevent your laptop from overheating.
  • On-the-Go Convenience: With an integrated handle and lightweight design (2.14 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
Rank #4
AboveTEK Portable Laptop Lap Desk w/Retractable Left/Right Mouse Pad Tray, Non-Slip Heat Shield Tablet Notebook Computer Stand Table w/Sturdy Stable Work Surface for Bed Sofa Couch or Travel
  • Anti-Slip Surface - Transform your laptop into a mobile workstation with the AboveTEK portable laptop lap desk. The anti-slip surface provides a strong grip for laptops up to 15.6 inches(Diagonal), while the double rubber strip on the bottom ensures a stable display or typing experience on your lap, couch, or bed.
  • Retractable Mouse Pad - Retractable laptop mouse pad extends on both directions for the left/right handed with elevation along the edges for stopping mouse from falling off. The size of laptop tray is 14" X 9.7" and the size of mouse pad is 7.4" X 6.1".
  • Effective Heat Shield - The effective heat shield made of sturdy and thick material protects your laptop from overheating. Prioritizes your comfort and safety, an ideal lap pad or board for working anywhere.
  • EASY to Carry and Store - With an ergonomic and simplistic design, the lap desk is portable to store in a backpack. Only 15" in size, 2.2 lb of weight and with slim 0.6 inch thickness, it is ready to be easily carried around.
  • Widely Applicable - The smooth platform accommodates laptops and tablets up to 15.6 inches(Diagonal), making it a versatile accessory and one of the best gifts for mom, dad, students and professionals. Perfect for use as a laptop bed tray or tablet holder anywhere at home, library, or park.
Rank #3
Sale
Yilador Webcam Cover 3 Pack, 0.03 inch Ultra Thin Laptop Camera Cover Slide
  • Note: Not suitable for MacBooks released after 2023 or devices with a protruding front camera; Not applicable to full-screen or notch-style tempered glass screen protectors; Do not use on the rear camera of the phone.
  • 💻 Why Do You Need a Webcam Cover Slide? — Safeguard your privacy by covering your webcam with our reliable webcam cover when not in use. Don't let anyone secretly watch you. Stay protected!
  • ✅ Thin & Stylish — Enhance your laptop's functionality and aesthetics with our 0.027" ultra-thin webcam covers. Seamlessly close your laptop while adding a touch of sophistication.
  • ✅ Fits Most Devices — Compatible with laptops, phones, tablets, desktops! Keep your privacy intact on Ap/ple, Mac/Book, iPh/one, iP/ad, H/P, L/novo, De/ll, Ac/er, As/us, Sa/msung devices.
  • ✅ 365 Days Protection — Our upgraded 3.0 adhesive ensures a strong hold that won't damage your equipment. Experience reliable, long-term privacy protection day in and day out.

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.