For a documented, direct full-page capture in Selenium Java, use FirefoxDriver’s getFullPageScreenshotAs(OutputType<X>) method. It captures the page beyond the current viewport and returns the format represented by the OutputType you request. The example below saves a PNG-compatible image file and always closes the browser.
Use FirefoxDriver’s full-page method
Selenium’s HasFullPageScreenshot interface defines getFullPageScreenshotAs(OutputType<X>), and FirefoxDriver implements that interface. This is the clearest Selenium Java API when Firefox is acceptable for your test or capture job.
- Make Selenium Java available to the project and install a Firefox version supported by the driver setup used by your project.
- Start
FirefoxDriver. - Navigate to the target URL.
- Call
getFullPageScreenshotAs(OutputType.FILE). - Copy or move the returned temporary file to your desired destination.
- Quit the driver in a
finallyblock, including when navigation or capture fails.
Complete Java example
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.firefox.FirefoxDriver;
public class FullPageScreenshot {
public static void main(String[] args) throws IOException {
FirefoxDriver driver = new FirefoxDriver();
try {
driver.get("https://example.com");
File temporaryScreenshot = driver.getFullPageScreenshotAs(OutputType.FILE);
Path destination = Path.of("artifacts", "example-full-page.png");
Files.createDirectories(destination.getParent());
Files.copy(temporaryScreenshot.toPath(), destination,
StandardCopyOption.REPLACE_EXISTING);
System.out.println("Saved: " + destination.toAbsolutePath());
} finally {
driver.quit();
}
}
}
The API call is explicitly documented as capturing the full page and storing it in the requested output type. OutputType.FILE gives you a temporary file; the copy step makes the artifact location predictable for CI systems and test reports. You can request another Selenium-supported output type when your workflow needs bytes or a Base64 value instead of a file.
Why getScreenshotAs is not enough
The widely used TakesScreenshot.getScreenshotAs method is suitable for a screenshot, but it is not a portable promise of full-document capture. Under W3C-conformant WebDriver behavior it follows the WebDriver specification. For non-conformant implementations, its documented behavior is browser-dependent best effort: the result may be the entire page, the current window, or only the visible frame portion.
Recommended Free Tools
#1 Best Overall
- FULL HD IPS DISPLAY - Enjoy vibrant, crystal-clear images with 178-degree wide-viewing angles
- AMD RYZEN 3 30 PROCESSOR - Everyday performance you can count on; Multitask, stream, game casually, and edit photos smoothly with responsive power and vibrant HDR visuals
- ENJOY UP TO 14 HOURS AND 15 MINUTES OF BATTERY LIFE - HP Fast Charge restores battery from 0 to 50% in approximately 45 minutes
- AMD RADEON 610M GRAPHICS - Experience smooth entertainment; Built for streaming and multitasking, enjoy realistic visuals and efficient performance for work and play
- STORAGE AND MEMORY - 512 GB PCIe NVMe M.2 SSD offers fast speed and efficient storage; and 8 GB LPDDR5 RAM memory boosts performance with higher bandwidth
Therefore, label a capture made with the generic method as a viewport screenshot unless you have verified the exact browser and driver behavior in your environment.
import java.io.File;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.firefox.FirefoxDriver;
FirefoxDriver driver = new FirefoxDriver();
try {
driver.get("https://example.com");
File viewportImage = ((TakesScreenshot) driver)
.getScreenshotAs(OutputType.FILE);
// This is a normal screenshot call; do not assume it contains the full document.
} finally {
driver.quit();
}
Choosing between the Selenium approaches
| Approach | Browser coverage | Full-page wording in the API | Main trade-off |
|---|---|---|---|
FirefoxDriver.getFullPageScreenshotAs |
Firefox | Explicitly full page | Requires Firefox when this direct API is the priority |
TakesScreenshot.getScreenshotAs |
Depends on the driver and browser | Not a cross-browser full-page guarantee | Simple and portable for viewport images, but document coverage must be verified |
Chrome DevTools Page.captureScreenshot |
Chrome/Chromium through a matching DevTools binding | Provides an optional captureBeyondViewport argument |
Coupled to generated protocol and browser versions |
The Chrome DevTools Java reference in Selenium 4.22.0 is generated for DevTools v124. Treat that route as version-sensitive: use the DevTools package that matches your Selenium release and browser, and verify the resulting image in the exact environment used by your build. It is not a universal replacement for Firefox’s explicit method.
Rank #2
- Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.
- 14" HD Display: 14.0-inch diagonal, HD (1366 x 768), micro-edge, anti-glare. See your digital world in a whole new way. Enjoy movies and photos with the great image quality and high-definition detail of 1 million pixels.
- Memory & Storage: 4 GB LPDDR4x & 64 GB eMMC Storage. Adequate high-bandwidth RAM to smoothly run multiple applications and browser tabs all at once. An embedded multimedia card provides reliable flash-based storage.
- Ports:2 x USB 3.0 Type-A,1 x USB 3.0 Type-C,1 x HDMI,1 x Headphone Jack
- Chrome OS: Chromebook is a computer for the way the modern world works, with thousands of apps. Enjoy the seamless simplicity that comes with Google Chrome and Android apps, all integrated into one laptop. It’s fast, simple, and secure.
Chrome and Chromium: handle the DevTools version deliberately
If Chrome is mandatory, investigate Selenium’s generated DevTools binding for the versions in your project. The Page.captureScreenshot command accepts an optional captureBeyondViewport parameter in the cited v124 binding. Package names, command signatures, and available domains can change with generated protocol versions, so copying an example that targets another Selenium/browser combination can fail at compile time or behave differently at runtime.
- Pin or otherwise control the Selenium version used by the build.
- Use the DevTools module generated for that Selenium release, not an arbitrary v-numbered package.
- Keep Chrome/Chromium within the compatibility range supported by your driver and binding.
- Confirm that the resulting image includes the complete document, rather than assuming that a successful command means full-page coverage.
Scrolling and stitching are not automatically equivalent to a full-page API. Sticky headers can be repeated, lazy media can remain unloaded, and animations or other dynamic content can change between scrolls. Those effects require application-specific validation; neither the generic screenshot contract nor the cited API references establish a universal fix.
Make captures deterministic
Wait for the page state you actually need
driver.get waits according to the browser’s page-load strategy, but a page can still render content afterward. If the screenshot must include a component, wait for that component with Selenium’s explicit-wait facilities before capturing. Choose a selector that represents the content being tested rather than using an arbitrary long sleep.
Rank #3
- Stunning 15.6" FHD IPS Display: Experience crisp 1920x1080 resolution on this 15.6 inch laptop with an IPS panel that delivers wide viewing angles and vivid colors. The narrow-bezel design maximizes screen real estate for comfortable viewing on this Win 11 laptop, whether you're studying or working.
- Celeron J4105 Processor & 256GB SSD: Powered by a reliable Celeron J4105 processor paired with 12GB DDR4 memory and a fast 256GB M.2 SSD. This laptop computer supports SSD expansion up to 2TB and TF card expansion up to 1TB, so your storage grows with your needs. Delivers smooth multitasking for daily productivity.
- AI-Powered Win 11 Laptop: Built-in AI features enhance your productivity with smart assistance for writing, summarizing, and task management. Pre-installed with Win 11 and includes Office 365 subscription. This student laptop is backed by 1-year warranty and 24/7 customer support.
- All-Day 7000mAh Battery & 180° Hinge: The high-capacity 7000mAh battery keeps this laptop powered through long classes or meetings. The 180-degree lay-flat hinge lets you share your screen effortlessly during presentations. This durable laptop computer adapts to your dynamic workflow.
- Versatile Connectivity Hub: Equipped with USB 3.2, Type-C, Mini HDMI, and 3.5mm audio jack to connect all your peripherals. Stay online anywhere with high-speed 5G WiFi and Bluetooth 4.2. This college laptop keeps you connected at home, in the library, or on the go.
Control dynamic content
Freeze or disable animations where your application permits it, and use stable test data. A full-page image can be technically complete while still differing between runs because of rotating banners, timestamps, personalized content, lazy loading, or a consent dialog.
Plan for very tall documents
Full-page images can be large. Store artifacts outside the source tree, give them deterministic names, and apply retention limits in CI. If your page is effectively unbounded (for example, an infinite feed), define a stopping condition or capture a bounded test fixture; “full page” cannot mean an endless document.
Common failures and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
getFullPageScreenshotAs does not compile |
The variable is typed only as a generic WebDriver, or the project’s Selenium API does not expose the interface on that type. |
Use a FirefoxDriver reference (or a type that exposes HasFullPageScreenshot) and ensure the Selenium Java dependency is the intended version. |
| Driver creation fails | Firefox, the driver, or the driver-management configuration is missing or incompatible. | Install a supported Firefox/driver combination and check the driver startup error before debugging screenshot code. |
| Image contains only the viewport | The code called generic getScreenshotAs, or a browser-specific implementation did not provide full-page behavior. |
Use Firefox’s explicit method, or verify the matching Chrome DevTools route and its beyond-viewport option. |
| Lower-page images are missing | Lazy loading has not been triggered or content appears after navigation. | Wait for the relevant element or page state before capture; validate the application’s lazy-load behavior in the target browser. |
| Repeated or shifted sticky elements | Scrolling/stitching behavior or page layout creates overlapping fixed elements. | Prefer a native full-page method and test pages with fixed headers separately. Do not assume stitching is visually lossless. |
| File disappears after the test | OutputType.FILE returns a temporary file. |
Copy it immediately to a permanent artifact directory, as shown in the example. |
| Browser remains running after an exception | quit() was not protected by cleanup logic. |
Keep driver shutdown in finally (or your project’s equivalent guaranteed-cleanup mechanism). |
Performance, reliability, and cost considerations
- Performance: A full-document image contains more pixels than a viewport image and can take more time and memory to encode and transfer. Keep capture frequency proportional to the diagnostic value of the artifact.
- Reliability: Browser, driver, Selenium, and DevTools versions all influence behavior. Record those versions with CI artifacts when image differences matter.
- Repeatability: Use a fixed viewport and stable test data where possible. Dynamic pages need explicit waits and content controls.
- Security: Screenshots can contain credentials, personal data, tokens rendered in pages, or internal URLs. Restrict artifact access and retention.
- Cost: Selenium itself runs in your browser environment, so infrastructure time and storage are your practical costs. A hosted API can shift browser maintenance and capture processing to a service instead.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP, or PDF. Before capture it accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status with X-Page-Verdict and X-Billed headers.
Free tools Windows power users keep installed
One-click scans. No signup required.
For a one-off full-page capture, use the API’s URL parameter and enable the full-page option when needed. The parameter names used by other screenshot APIs also work, which can reduce migration changes. The service also supports element capture, device presets, arbitrary viewports, retina scale, PDF settings, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification.
Rank #4
- Efficient Performance for Everyday Computing: Powered by Intel N150 processor with up to 3.6 GHz Intel Turbo Boost Technology, 6 MB L3 cache, 4 cores, and 4 threads, this HP laptop delivers responsive performance for web browsing, streaming, document editing, and multitasking. Paired with 4GB LPDDR5 RAM and 128GB UFS storage, it handles daily tasks smoothly. Includes 1-year Microsoft 365 Personal subscription for Word, Excel, PowerPoint, and cloud storage to maximize your productivity.
- 14-Inch HD Micro-Edge Display:Enjoy clear visuals on the 14-inch HD (1366 x 768) anti-glare screen with 250-nit brightness and 62.5% sRGB coverage. The micro-edge bezel delivers a 79% screen-to-body ratio in a compact design. An HP True Vision 720p HD camera with noise reduction and dual-array microphones supports clear video calls, remote work, and online learning.
- Modern Connectivity and Wireless Technology: Stay connected with Wi-Fi 6 (2x2) for faster wireless speeds and Bluetooth 5.4 for seamless pairing with accessories. Versatile port selection includes 1 USB Type-C 10Gbps with DisplayPort 1.2 for external displays, 2 USB Type-A 5Gbps ports for peripherals, 1 HDMI 1.4b port, 1 headphone/microphone combo jack, and 1 multi-format SD media card reader. Connect monitors, transfer files quickly, and expand your workspace with ease.
- All-Day Battery Life and Portable Design: Enjoy up to 11 hours of video playback, 7.5 hours of mixed usage, or 7.5 hours of wireless streaming on a single charge, perfect for students and professionals on the go. Weighing just 3.24 lb and measuring 12.76" x 8.86" x 0.71", this lightweight laptop fits easily in backpacks and bags. The stylish willow green top cover with matte finish and natural silver keyboard deck with vertical brushing pattern offer a modern, professional look.
- AI-Enhanced Productivity: Access Microsoft Copilot instantly with the dedicated Copilot key for faster assistance. AI Noise Reduction filters background sounds and improves voice clarity during calls. Dual speakers provide clear audio, while the full-size natural silver keyboard and HP Imagepad support comfortable typing and navigation.
cURL
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://example.com
-o shot.webp
Python
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://example.com"},
timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://example.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const body = Buffer.from(await res.arrayBuffer());
require('fs').writeFileSync('shot.webp', body);
See the ScreenshotNeo documentation for option names and response headers. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots; every feature is available on every plan, and yearly billing gives two months free. Create a free ScreenshotNeo account to try the 1,000 monthly screenshots.
Best Value
- 【Powerful Performance】Equipped with an Intel N150 CPU, featuring up to 4.4 GHz, 4 cores, and 4 threads, ensuring efficient and powerful multitasking capabilities.
- 【Expansive Display】The 14 Non-touch display offers clear and vibrant visuals, 250 nits brightness, and anti-glare coating, perfect for both work and entertainment.
- Designed for mobility with a slim 0.71-inch profile and lightweight 3.24 lb chassis, making it easy to carry between home, office, school
- 【Versatile Connectivity】Stay connected with multiple ports including USB 3.0 Type-C, USB 3.0 Type-A, HDMI, and a headphone/mic combo jack, along with Wi-Fi and Bluetooth for seamless wireless networking.
- One Year Microsoft 365
Frequently Asked Questions
Can Selenium capture a full page in every browser?
No. FirefoxDriver exposes an explicit full-page method. The generic screenshot API is browser-dependent, and Chrome DevTools capture is tied to matching generated protocol versions.
What does OutputType.FILE return?
It returns a temporary image file. Copy that file to your own artifact directory before cleanup or process termination.
Why is a full-page image different on two identical runs?
Late-rendered content, lazy loading, animations, personalization, timestamps, consent UI, and sticky elements can change the pixels. Use explicit waits and stable test data, then validate the page-specific behavior.
The Bottom Line
Use FirefoxDriver.getFullPageScreenshotAs(OutputType.FILE) when you want Selenium’s most direct documented full-page API. Treat generic screenshots as viewport captures unless verified, and treat Chrome DevTools capture as version-specific.
Quick Recap
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.

