Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsTo capture the entire scrollable document in Playwright, call the Page screenshot API with fullPage: true: await page.screenshot({ path: 'screenshot.png', fullPage: true }); Without that option, the screenshot covers the current viewport. Use a locator screenshot for one element, and Playwright Test’s toHaveScreenshot assertion when you need a visual regression check rather than a one-off image.
Capture a full page with Playwright
Playwright describes a full-page screenshot as capturing the full scrollable page, “as if you had a very tall screen and the page could fit it entirely.” The key option is fullPage; it defaults to false. Set it to true on page.screenshot() to capture the whole scrollable document rather than just what is currently visible.
JavaScript: save the screenshot to a file
await page.screenshot({ path: 'screenshot.png', fullPage: true });
This assumes you already have a Playwright page open and have navigated to the page you want to capture. The file extension can determine the output image type. If you need the code to run from a fresh browser session, the following example includes setup, navigation, capture, and cleanup:
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
try {
await page.goto('https://example.com');
await page.screenshot({ path: 'screenshot.png', fullPage: true });
} finally {
await browser.close();
}
Replace https://example.com with the page you control or are authorized to capture. The example saves a PNG in the current working directory. It does not add application-specific waiting, authentication, or content-loading logic.
#1 Best Overall
Python and other language bindings
Playwright bindings use language-specific naming conventions. In Python, the option is full_page, not JavaScript’s fullPage. The synchronous and asynchronous forms are:
# Synchronous Python
page.screenshot(path="screenshot.png", full_page=True)
# Asynchronous Python
await page.screenshot(path="screenshot.png", full_page=True)
Java uses setFullPage(true) on its screenshot options. Use the naming and call style for the binding installed in your project; do not copy JavaScript option names unchanged into another language.
Choose the right kind of screenshot
Before adding options, decide what the image should represent. A viewport capture, a full-page capture, and an element capture are not interchangeable.
| Method | What it captures | Use it for |
|---|---|---|
page.screenshot() with default fullPage: false |
The visible viewport | A screen as a visitor currently sees it |
page.screenshot({ fullPage: true }) |
The full scrollable page | Page documentation or a whole-page visual artifact |
locator.screenshot() |
The matching element, clipped to its size and position | A component, card, chart, or other specific region |
Playwright Test toHaveScreenshot |
A screenshot used in a visual assertion | Regression checks in the Playwright test runner |
Capture one element
Use a locator screenshot when the page is not the unit you need to capture. Playwright scrolls the element into view and waits for actionability checks before taking the image. The screenshot is clipped to the element’s size and position. If another element covers it, the covered portion will not appear as though the overlay had been removed. For a scrollable container, the capture includes only the content currently scrolled into view inside that container, not all of the container’s scrollable contents.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Use screenshot assertions for visual regression
A saved image is useful for inspection or documentation, but it is not by itself a test assertion. In Playwright Test, toHaveScreenshot waits for two consecutive screenshots to match, then compares the last capture with the expectation. This assertion is available in the Playwright test runner; it is not a general-purpose assertion for every way of using Playwright.
Get a buffer instead of writing a file
When you omit path, page.screenshot() returns a buffer. That lets the next step in your code process or encode the image, or pass it to a pixel-diff workflow, without first saving it to disk.
const image = await page.screenshot({ fullPage: true });
// Pass `image` to your image-processing or comparison code.
Choose a path when you want a straightforward artifact on disk. Choose a returned buffer when your application needs to handle the bytes directly. The screenshot call returns the image data; the specific processing or comparison step depends on the tool your project uses.
Control format, size, and appearance
The Page screenshot API has options for output format, image scale, animation, masking, caret, and background. These settings affect the artifact; they do not guarantee identical output across every application or execution environment.
Rank #3
| Option | What it does | Practical consideration |
|---|---|---|
path |
Saves the screenshot to a file; the extension can determine the output type. | Omit it if you want the returned buffer instead. |
type |
Selects PNG, JPEG, or WebP. | Choose based on how the image will be used. |
quality |
Sets quality for JPEG and WebP, not PNG. | The documented JPEG default is 80. The documented WebP default is 100, which is lossless. |
scale |
Controls whether output pixels follow CSS pixels or device pixels. | css gives one output pixel per CSS pixel. device uses device pixels and can produce larger images on high-DPI displays; the documented default is device. |
animations |
Controls CSS animations, transitions, and Web Animations. | disabled stops animations; finite and infinite animations are handled differently. allow leaves them running and is the documented default. |
mask and maskColor |
Cover selected locators in the screenshot. | The documented default mask color is pink, #FF00FF. |
caret |
Controls whether the text caret is shown. | Hiding it is the documented default. |
omitBackground |
Omits the default white background for transparency. | It does not apply to JPEG. |
Choose a scale deliberately
scale: 'css' makes the output correspond to CSS-pixel dimensions, while scale: 'device' uses device pixels. On high-DPI displays, device-pixel output can be larger. That can matter when images are stored, transferred, or compared, but the documentation does not establish a universal maximum image dimension or memory bound. Do not assume a specific height ceiling or identical behavior among browsers based on these option descriptions alone.
Make dynamic pages more consistent
If an animation or flashing caret makes captures vary, the documented controls can suppress those elements. Mask selected locators when particular regions should be covered in the screenshot. These options address specific sources of visual variation; they do not make every page deterministic. Content that changes for other reasons can still change between captures.
Practical capture checklist
- Navigate first. Use your existing page setup and navigate to the intended URL before taking the screenshot.
- Pick the coverage. Use
fullPage: truefor the entire scrollable page, the default viewport capture for the visible screen, or a locator screenshot for one matching element. - Select output. Set
pathto save a file, or omit it when you need the returned buffer. - Choose image options. Select PNG, JPEG, or WebP as appropriate, then consider quality and CSS-pixel versus device-pixel scale.
- Control known variation. Decide whether animations should run, whether selected elements should be masked, whether the caret should be hidden, and whether transparency is needed.
- For regression checks, use the test assertion. Use
toHaveScreenshotwithin Playwright Test when the goal is to compare an image with an expected result.
Troubleshooting full-page captures
The screenshot shows only the viewport
Likely cause: the call omitted fullPage: true, or a language binding’s equivalent option was not set. The default is viewport-only. Fix: set fullPage: true in JavaScript, full_page=True in Python, or the corresponding option for your binding.
The capture includes more than the element you wanted
Likely cause: you used a Page screenshot when the target was a specific component. Fix: take a locator screenshot for the matching element. Conversely, if you chose a locator screenshot for a scrollable container expecting all of its internal content, note that the locator capture shows only the currently scrolled content; it does not turn that container into a full-page document capture.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
An element is missing or partly covered
Likely cause: another element overlays the target, or the page’s current content does not put the target in the visible capture. Locator screenshots do not make covered content visible. Fix: inspect the page state and the target’s position before capturing, and choose Page versus locator capture based on the content you need. Do not treat a locator screenshot as a way to remove overlays.
The output is larger than expected
Likely cause: device-pixel scaling, especially on a high-DPI display, or a large full-page document. Fix: consider scale: 'css' if CSS-pixel output suits your workflow. The available documentation does not state a universal dimension or memory limit, so test against your own page and environment rather than relying on a numeric ceiling.
Repeated captures differ
Likely cause: an animation or caret is visible, or some other page content changes between runs. Fix: consider animations: 'disabled' or the caret and mask options for the specific variation. For a visual regression check, use Playwright Test’s screenshot assertion, which waits for two consecutive matching captures before comparing against the expectation. That waiting behavior does not guarantee that unrelated dynamic content will stop changing.
Reliability, performance, and version notes
A full-page image covers more than a viewport image, and device-pixel scaling can produce larger output on high-DPI displays. That is a practical reason to choose the smallest useful capture scope and image scale for your downstream workflow. The available API documentation does not establish a universal maximum height, a memory bound, a speed figure, or identical behavior across browsers, so no single numeric performance expectation applies here.
Best Value
Option defaults and availability can change between releases. The documentation reflected in the available material is on Playwright’s next documentation path rather than tied to a pinned package release. If an exact default or option matters to a production workflow, check the documentation matching the Playwright version installed in your project.
Or skip the browser setup
If you need an image from a URL without opening and managing a Playwright browser session, ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF. Its capture flow accepts cookie and consent banners like 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 and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers.
For a one-call WebP capture, use cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
Use your ScreenshotNeo API key in place of YOUR_API_KEY. See the ScreenshotNeo API documentation for the available request parameters and response details.
There is also an MCP server for AI agents, with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Every feature is on every plan.
Free tools Windows power users keep installed
One-click scans. No signup required.
Sign up for ScreenshotNeo to get 1,000 screenshots a month free, with no card required.
Frequently asked questions
Can I use a full-page screenshot as a visual regression baseline?
Yes. A capture can serve as an image artifact, and Playwright Test’s toHaveScreenshot can compare a screenshot with an expectation. Use the assertion in the Playwright test runner.
Does omitBackground make a JPEG transparent?
No. The documented transparency option does not apply to JPEG; choose a format that supports the transparency you need.
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.
Recommended Free Tools

