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

Playwright supports screenshots. Start with await page.screenshot({ path: 'screenshot.png' });. If that call reports that taking screenshots is not allowed, the restriction is usually outside the Page API: a managed Chromium policy, kiosk or launch setting, browser extension, externally controlled browser, or a remote test service may be denying capture. First prove the call in a clean Playwright-managed browser, then compare the failing environment and involve the administrator who controls it.

Start with a known-good screenshot call

Reduce the test to one page, one navigation, and one writable PNG path. The path option writes the captured image to disk; without it, Playwright returns the image as a buffer.

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1280, height: 800 } });
await page.goto('https://example.com', { waitUntil: 'load' });
await page.screenshot({ path: 'screenshot.png' });
await browser.close();

Run this from a directory where the test user can create files. Use a simple filename first rather than a protected absolute path, network share, or temporary directory that is cleaned immediately by CI. A successful run creates screenshot.png and proves that the basic API, browser binary, and local output path work together.

What the prohibition message actually means

Playwright documents screenshot capture as a supported Page API. The same API supports a viewport shot, a full-page shot, a buffer, and a screenshot of a locator. Therefore, “taking screenshots is not allowed” is not a switch you normally enable in a Playwright test. It is a clue that another layer is refusing the operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Kodak PIXPRO FZ45 Digital Camera, 16MP Point & Shoot (Black)
  • 16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting
  • Optical Zoom: 4x optical zoom with a 27mm wide angle lens for flexible framing indoors or outdoors
  • Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
  • Memory Support: Works with Class 10 SD, SDHC, or SDXC cards up to 512GB
  • LCD Screen and Battery: 2.7in LCD screen with 2 AA alkaline batteries for convenient on-the-go use

The restriction can be narrow or broad. A path permission problem affects file output but not an in-memory buffer. A selector or page-state problem affects one element or one page. A browser policy, extension, kiosk profile, remote capability setting, or organization-wide data-control rule can reject every capture mode. A browser connected through an external endpoint may also have capabilities that differ from a browser launched by Playwright.

Chromium enterprise policy

Chromium’s policy template defines DisableScreenshots. When that policy is enabled, screenshot actions through keyboard shortcuts or extension APIs are disabled; when it is disabled or unspecified, those actions are allowed. In a managed deployment, the policy and other organization controls can be the layer that determines whether a Playwright capture succeeds. The policy owner, not the test author, must change an enforced setting.

Other environment restrictions

  • Externally connected browser: a grid, hosted browser, or debugging endpoint may expose a reduced capability set.
  • Kiosk or custom launch configuration: flags and profile settings can intentionally prevent capture.
  • Extensions: security, privacy, or recording extensions can intercept or deny screenshot operations.
  • Remote service rules: a provider may disable screenshots for a project, browser type, or data class.
  • Filesystem failure: a read-only working directory, invalid path, or quota error can look like a screenshot failure even though capture itself is permitted.

Use a clean control test to isolate the layer

  1. Record the failing context. Save the exact error text and note the Playwright version, browser engine, whether Playwright launched the browser or connected to one, CI or provider name, launch arguments, extensions, kiosk mode, and profile or user account.
  2. Launch a fresh Playwright browser. Use a new browser context with no extensions, custom profile, or organization-specific flags. Repeat the minimal call above.
  3. Compare results. If the clean run works, the API is functioning and the failing environment is the variable to investigate. Compare browser binaries, command-line arguments, profile policies, extension lists, remote capabilities, and service-side settings.
  4. Try a buffer. Remove path and assign the result to a variable. This separates image capture from filesystem output.
  5. Try one element and one full page. These modes reveal whether the issue is tied to page size, locator state, or all screenshot operations.
  6. Reproduce in the same identity. A local administrator account can produce a different result from the CI service account or managed user profile. Test with the identity that actually runs the job.
  7. Ask the policy owner. If an enterprise or provider rule is enforced, request an approved exception for the test project or origin rather than attempting to bypass it.

Verify each documented capture mode

Playwright exposes separate modes, so test them independently. The following script writes a viewport image, a full-page image, an element image, and a buffer.

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', { waitUntil: 'networkidle' });

await page.screenshot({ path: 'viewport.png', type: 'png' });
await page.screenshot({ path: 'full-page.png', fullPage: true, type: 'png' });
await page.locator('body').screenshot({ path: 'body.png' });
const buffer = await page.screenshot({ type: 'png', scale: 'css' });
console.log(`Captured ${buffer.length} bytes in memory`);

await browser.close();
Test What it checks If it fails while another works
Viewport file Basic capture plus path permissions Check the working directory and write access if a buffer succeeds
Buffer Capture without filesystem output If this fails too, suspect browser, policy, extension, or remote capability
Full page Scrolling and lazy-loaded page content Investigate page layout, very large documents, or page-specific timeouts
Locator Element resolution and element visibility Check the selector, attachment, visibility, and timing

Other documented options include clip for a rectangle, scale for CSS or device pixels, type for PNG, JPEG, or WebP output, and timeout for the capture operation. Change one option at a time so a policy failure is not confused with a page-state or sizing failure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Kodak PIXPRO FZ55-BK 16MP CMOS Sensor Camera 5X Optical Zoom 28mm Wide
  • 16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting
  • Optical Zoom: 5x optical zoom with a 28mm wide angle lens for flexible framing indoors or outdoors
  • Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
  • Memory Support: Works with Class 10 SD, SDHC, or SDXC cards up to 512GB
  • LCD Screen and Battery: 2.7in LCD screen and a rechargeable lithium-ion battery for on-the-go use

Check managed browser policy without crossing an authorization boundary

Use the Chromium policy reporting interface supplied by your organization or browser image and search for DisableScreenshots. Also check data-loss-prevention or other data-control rules that may apply to the profile, origin, or project. A policy can be applied at startup or refreshed according to the deployment, so relaunch the browser after an authorized change and rerun the control test.

Do not remove management enrollment, inject a replacement extension, alter a protected profile, or use an unapproved remote endpoint to defeat a workplace, school, assessment, DRM, or customer restriction. The correct fix is an administrator-approved policy change or an approved test environment. Record the policy name and scope in the ticket so the owner can make a targeted decision.

CI and remote-browser checks

Playwright-managed versus externally connected

A Playwright-managed browser gives you control of the executable, context, profile, and launch arguments. With an externally connected browser, those choices may belong to a grid or service. Capture the connection mode in logs and ask the service owner whether screenshots are enabled for the session type. A clean local run that succeeds does not prove that a remote project permits capture.

Flags, profiles, and extensions

Compare the complete launch argument list, not just the visible test code. Remove nonessential flags and extensions for the control run, use a fresh profile, and then add components back one at a time. This makes an intentional blocker identifiable and avoids blaming the page under test.

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 #3
Sale
Digital Camera, Latest FHD 1080P Digital Camera for Teens with SD Card Anti Shake Point and Shoot Cameras Portable 16X Zoom Compact Small Cameras for Kids Boys Girls Seniors with Wrist Strap
  • Latest Digital Camera Built-in Fill Light : This compact digital camera is paired with a powerful CMOS processor and image stabilization to help you take & record the most exciting moments in 44 MP quality images & FHD 1080P quality videos anywhere, anytime. Plus, there is also a built-in fill light to help you take high quality pictures even in low light&dark settings, making this the perfect camera for all indoors/outdoors situations.
  • Long-Lasting Battery Life & 16X Digital Zoom :This point and shoot camera will retain its battery charge even after long use. The controls and functions are easy to operate making this the perfect choice for children, teens and younger. This kids camera supports 16x digital zoom, you can zoom in or out the subject by pressing the W/T button for taking still photos to zoom in or out on distant objects and capture all the details you need.
  • Multifunctional & Portable Digital Camera: This cheap digital camera is slim enough to fit in your pocket. You'll easily be able to take it with you on all your indoor/outdoor activities and adventures and ideal for beginners, children and teenagers. This kids digital camera is equipped with 20 filters, anti-shaking, self-timer, continuous shooting, date stamp, time-lapse recording, smile capture, internal MIC and speaker (recording sound videos), great for your daily photography needs.
  • WEBCAM & PAUSE FUNCTION : More than just a FHD 1080p digital camera, it also works as a webcam for video calls and vlogging. Connect the camera to the computer, press shutter and power button at the same time and the camera will automatically turn on webcam mode for all your video calling and live streaming needs. The pause function allows you to pause when seeing playback videos.
  • A Must Have Photography Device : This digital camera with SD card made from high-quality materials, this retro camera is safe and durable. Perfect for all ages to develop & improve their photographic abilities and observation skills. Our dedicated and experienced 24/7 support team is available for all after purchase troubleshooting, questions and technical help.

Paths and artifacts

In CI, create the artifact directory before the test, use a path relative to the job workspace, and publish the file before cleanup. If a buffer succeeds but the file is missing, save the buffer yourself and inspect the runner’s permissions and artifact rules. This is a storage problem, not evidence that the browser disallows screenshots.

Troubleshooting by symptom

Symptom Likely cause Next action
The minimal call says screenshots are not allowed in every mode Managed policy, extension, kiosk setting, or remote capability Run the fresh-browser control, compare policy and launch settings, and contact the owner of the controlling environment
Buffer works but path fails Directory, permissions, invalid filename, quota, or artifact handling Use a writable workspace path and save the returned buffer explicitly
Viewport works but full-page fails Page size, scrolling, lazy content, or a capture timeout Capture the viewport first, wait for the required content, then adjust page-specific timing or size
Locator capture fails Selector does not match, element is detached, hidden, or not ready Wait for the locator, verify visibility, and capture a stable ancestor or the page for comparison
Only CI fails Different user, profile, browser binary, flags, extension, policy, or remote service Log those variables and reproduce with the CI identity in a clean approved environment
Only an externally connected browser fails Provider or grid capability restriction Check project capabilities and request screenshot permission from the service owner
The error appears after a browser update Policy refresh, profile change, extension compatibility, or changed launch defaults Compare the previous and current browser configuration and rerun the clean control

Reliability and performance practices

  • Use a deterministic viewport and a fresh context when diagnosing; this removes state carried by earlier tests.
  • Wait for the condition your page needs rather than adding an arbitrary long delay. Playwright supports waiting for selectors, and screenshot capture has its own timeout option.
  • Use a buffer when the next step is upload, comparison, or in-memory processing; write a file only when a human or CI artifact needs it.
  • Prefer the smallest capture that answers the test question. Full-page images can be much larger and require scrolling through a long document.
  • For reproducibility, log the URL, browser engine, viewport, output type, full-page or element mode, and whether the browser was managed locally or externally.
  • Keep a policy-approved control project. It gives you a baseline when a shared runner, profile, or browser image changes.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup:

If your goal is a clean website image rather than browser automation, ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP, or PDF. It accepts cookie or consent banners like a visitor, then removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be disabled.

Its response reports the page verdict and billing status in X-Page-Verdict and X-Billed headers. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed. That makes it useful when a remote Playwright environment is blocked or when you need a repeatable capture endpoint rather than a browser profile.

One-call cURL example

See the parameter reference in the ScreenshotNeo documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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,
)
r.raise_for_status()
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}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

ScreenshotNeo also supports full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets or custom viewports, retina scale, PDF paper and page-range controls, custom CSS and JavaScript, clicks before capture, hidden selectors, waits for selectors, delays or network idle, blocking ads, trackers, requests or resource types, custom headers, cookies, user agents and Authorization, timezone and geolocation, transparent backgrounds, resizing, selectable cache TTLs, signed image links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification. Common parameter names used by other screenshot APIs also work.

Rank #4
Kodak PIXPRO FZ55-RD 16MP Camera 5X Optical Zoom 28mm Wide Angle 1080p
  • 16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting
  • Optical Zoom: 5x optical zoom with a 28mm wide angle lens for flexible framing indoors or outdoors
  • Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
  • Memory Support: Works with Class 10 SD, SDHC, or SDXC cards up to 512GB
  • LCD Screen and Battery: 2.7in LCD screen and a rechargeable lithium-ion battery for on-the-go use

The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots; higher listed plans are Growth at $15 for 15,000, Pro at $39 for 60,000, Scale at $99 for 250,000, and Business at $249 for 1,000,000. Yearly billing gives two months free, and every feature is available on every plan. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients, so an AI agent can request captures without your Playwright browser setup.

Create a free ScreenshotNeo account to use the 1,000 monthly screenshots without adding a card.

Frequently Asked Questions

Can I keep using Playwright if an organization blocks screenshots?

Yes, for the rest of your browser tests, but screenshot assertions will continue to fail until the policy owner provides an approved exception or test environment. Do not attempt to bypass an enforced control.

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

Does changing PNG to JPEG or WebP override a screenshot restriction?

No. Output type changes the encoded image, not whether the browser or remote service permits capture. Test a buffer and a file separately to distinguish policy from storage problems.

Why does a clean local browser pass while the same test fails on a grid?

The grid controls its browser image, profile, extensions, launch flags, identity, and capabilities. Compare those settings and ask the grid administrator whether screenshot capture is enabled for your project.

Quick Recap

SaleBestseller No. 1
Kodak PIXPRO FZ45 Digital Camera, 16MP Point & Shoot (Black)
Kodak PIXPRO FZ45 Digital Camera, 16MP Point & Shoot (Black)
16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting; Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
$99.99
SaleBestseller No. 2
Kodak PIXPRO FZ55-BK 16MP CMOS Sensor Camera 5X Optical Zoom 28mm Wide
Kodak PIXPRO FZ55-BK 16MP CMOS Sensor Camera 5X Optical Zoom 28mm Wide
16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting; Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
$139.99
Bestseller No. 4
Kodak PIXPRO FZ55-RD 16MP Camera 5X Optical Zoom 28mm Wide Angle 1080p
Kodak PIXPRO FZ55-RD 16MP Camera 5X Optical Zoom 28mm Wide Angle 1080p
16MP Sensor: Captures detailed photos with a CMOS sensor for everyday shooting; Full HD Video: Records 1080p video for travel clips, family moments, or simple vlogging
$139.99

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.