Playwright does not expose a shell.screenshot API. For browser automation, use page.screenshot() for a page or locator.screenshot() for one element. Add fullPage: true when you need the entire scrollable document. The exact name [shell.screenshot] appears in Noctalia documentation for desktop screenshot configuration, which is unrelated to Playwright.
Use the Playwright screenshot API, not shell.screenshot
The Playwright API is attached to a page or locator:
page.screenshot()captures the browser page.page.locator('selector').screenshot()captures one matching element.
A screenshot call can write an image file when you provide path, or return image bytes when you omit it. PNG is the documented default. Playwright also provides controls for image type, scaling, animation handling, masking and injected styling.
Quick start: save a page screenshot in JavaScript
Install Playwright, then run this complete Node.js example:
Recommended Free Tools
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
import { chromium } from 'playwright';
const browser = await chromium.launch();
const context = await browser.newContext();
const page = await context.newPage();
await page.goto('https://example.com');
await page.screenshot({ path: 'screenshot.png' });
await browser.close();
page.goto() loads the URL, and page.screenshot({ path: 'screenshot.png' }) writes the visible viewport to that file. Closing the browser matters in scripts and test runners because it releases the browser process and its resources.
Choose the capture you actually need
| Goal | API or option | Result |
|---|---|---|
| Visible browser viewport | page.screenshot({ path: 'shot.png' }) |
Only the currently visible area. |
| Entire scrollable page | page.screenshot({ path: 'full.png', fullPage: true }) |
One image containing the full page height. |
| One component | page.locator('.header').screenshot({ path: 'header.png' }) |
The matched element after Playwright checks it and scrolls it into view. |
| Process the image in memory | const buffer = await page.screenshot(); |
A buffer instead of a file. |
Use the viewport form for a browser-like snapshot, fullPage for documentation or archival captures, and a locator for component-level evidence.
How to capture a full-page screenshot
Set fullPage: true:
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
await page.goto('https://example.com');
await page.screenshot({
path: 'example-full-page.png',
fullPage: true
});
await browser.close();
This captures the page’s scrollable content rather than only the initial viewport. Very long pages can create large images, so choose a practical viewport width and monitor memory when processing many URLs.
How to screenshot one element
Use a locator rather than the older ElementHandle screenshot API:
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteconst card = page.locator('.pricing-card').first();
await card.screenshot({ path: 'pricing-card.png' });
Locator screenshots perform actionability checks and scroll the matched element into view. If another element covers it, the covered content will not appear as visible in the image. For a scrollable container, the capture contains the portion currently visible in that container, not every item hidden beyond its scroll position.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Prefer a selector that identifies one stable element. If a selector matches several nodes, narrow it with a class, role, text condition or .first() so the intended component is unambiguous.
Save a file or keep the screenshot as bytes
Write directly to disk
await page.screenshot({
path: 'artifacts/home.png',
type: 'png'
});
Playwright creates the image at the path you provide. Keep artifact directories separate from source files so test cleanup and CI uploads are predictable.
Return a buffer for further processing
const image = await page.screenshot({ type: 'png' });
await uploadToStorage(image);
When path is omitted, the call returns image bytes. This is useful when an application uploads the result, computes a digest or passes it to another image processor without creating a temporary file.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Control image fidelity and page state
The screenshot options documented by Playwright let you tune the result:
- Image type: choose the supported output type instead of relying on the PNG default.
- Scale: CSS scale maps one output pixel to one CSS pixel; device scale uses device pixels and can produce larger images on high-DPI displays.
- Animation handling: control animations when a moving UI would make captures unstable.
- Masking: cover changing regions such as timestamps or user-specific values so comparisons focus on the layout.
- Injected styling: add temporary styles for a capture without changing the application’s source.
Set the browser context’s viewport explicitly when screenshots are compared over time. A different viewport changes wrapping, breakpoints and total page height.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Wait for the page before capturing
A screenshot records the state that exists at the moment the call runs. Navigate first, then wait for the page state your image requires. For a component, locating it before capture also makes the intended target explicit:
await page.goto('https://example.com/dashboard');
const chart = page.locator('[data-testid="sales-chart"]');
await chart.screenshot({ path: 'sales-chart.png' });
If content is populated asynchronously, wait for a selector or another application-visible condition before taking the image. Do not use an arbitrary delay as a substitute for a reliable readiness signal unless the page has no better observable state.
Free tools Windows power users keep installed
One-click scans. No signup required.
Use the Playwright CLI when you do not need a script
Playwright’s CLI has a screenshot command for a viewport capture and a screenshot [target] form for a target element. Its documented options include a custom filename, image type, full-page capture and high-resolution device-pixel capture. The CLI is convenient for a one-off image; use the API when you need authentication, waits, branching logic or many URLs.
Screenshot testing and visual comparisons
Playwright Test can capture screenshots after all tests, only after failures or after the first failure. Its visual assertion API compares a new capture with a reference screenshot.
Rendering is not guaranteed to be identical across operating systems, browser versions, browser settings, hardware, power sources or headless mode. Keep the baseline and comparison environments consistent. Pin the browser version used by the test project, use the same viewport and scale, and avoid dynamic content or mask it before comparison. A changed font, animation frame or device-pixel setting can produce a difference even when the application code did not change.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Common failures and fixes
shell.screenshot is not a function
This is a naming error. Replace it with page.screenshot() or a locator’s screenshot() method. Do not expect the Noctalia [shell.screenshot] configuration to work in Playwright.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
The image is blank or the page is incomplete
Check that navigation completed and that the application rendered the required state before capture. Add a wait for a meaningful selector, verify the URL, and inspect the page in headed mode when diagnosing a rendering issue.
The element cannot be found
Confirm the selector matches the current DOM and that the element is created after navigation. Prefer a stable test identifier or role-based locator. If multiple elements match, narrow the locator before calling screenshot().
The element is hidden or covered
Locator screenshots require an actionable, visible target. Close overlays, wait for the component to become visible, or capture the covering state intentionally. An element hidden behind another element will not appear as visible pixels.
The full-page image is unexpectedly large
Full-page mode includes all scrollable content. Reduce unnecessary page length for the test fixture, use a locator capture when only one section matters, or process the returned buffer without keeping many large images in memory.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Visual tests fail only on one machine
Compare operating system, browser version, viewport, scale, headless mode, fonts and power-related rendering differences. Recreate the baseline in the same environment used for comparison instead of accepting a mismatch caused by infrastructure drift.
Animations make captures differ
Use Playwright’s animation handling option or injected styling to freeze the moving region. Mask values that legitimately change between runs.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Performance, reliability and cost considerations
- Browser startup: launch one browser and reuse a context or page for a batch where isolation requirements allow it; repeatedly starting browsers adds overhead.
- Image size: full-page and device-pixel captures consume more memory and storage than viewport captures. Select the smallest mode that answers the question.
- Determinism: fixed viewport, browser version, scale and page state produce more useful baselines than simply taking more screenshots.
- Failure handling: save screenshots only after navigation and readiness checks succeed, and preserve the URL and test name with each artifact so a failed image can be traced.
- Privacy: mask or remove account details and other user-specific regions before storing artifacts.
Playwright itself does not charge per screenshot; your costs come from the machine, browser runtime, storage and any hosted browser service you choose.
Or skip the browser setup
ScreenshotNeo is the first alternative to try when you need a screenshot API: it removes cookie-consent banners, newsletter popups and chat widgets before capture, bills only clean shots, and has a $5 Starter plan for 3,000 shots. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and each response identifies the page verdict and billing status in X-Page-Verdict and X-Billed headers.
One GET request returns PNG, JPEG, WebP or PDF. You can request full pages with lazy images loaded, select one element by CSS selector, set a viewport or one of 12 device presets, use retina scale, wait for a selector, delay or network idle, run custom CSS or JavaScript, click before capture, hide selectors, block ads, trackers, requests or resource types, provide headers, cookies, a user agent or Authorization, set timezone and geolocation, use a transparent background, resize images, cache with a chosen TTL, create signed links, submit asynchronous jobs with signed webhooks, capture up to 100 URLs per bulk call, query usage, or use the OpenAPI specification. Its MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.
Use the same request from a shell:
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}`);
See the ScreenshotNeo documentation for request parameters. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots, and every feature is available on every plan. Create a free ScreenshotNeo account.
Frequently Asked Questions
Can I combine fullPage with a locator screenshot?
No. fullPage is a page-level capture option. Use page.screenshot({ fullPage: true }) for the document, or call locator.screenshot() when the target is one element.
Which output should a visual regression pipeline archive?
Archive the exact image type and scale used by the comparison baseline, together with the browser, viewport and test-environment details. Changing those inputs can create a visual difference unrelated to your UI change.
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.

