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

A screenshot request can fail at several different layers. In Playwright, requestfailed means the browser did not receive an HTTP response at all; a 404 or 503 is different because it is an HTTP response and completes through the normal response lifecycle. A screenshot assertion can also fail after the page loaded, and a timeout only means that the expected signal did not arrive before the deadline. Detect the layer first, preserve the evidence, and only then decide whether to retry.

Classify the failure before fixing it

Use the signal that matches the operation you were performing. Treating every problem as a timeout hides the useful distinction between transport, HTTP, rendering, and assertion failures.

Failure layer What you observe What it means First check
Transport or network Playwright requestfailed, often with an error such as net::ERR_FAILED No HTTP response was obtained Failure text, DNS/TLS/proxy connectivity, interception rules
HTTP response response and usually requestfinished with status 404, 503, or another error code The server answered, but the status is an application or server error Status, headers, redirect chain, and response body where safe
Wait timeout A response, selector, navigation, or screenshot wait rejects after its configured limit The expected observation did not arrive in time; the action may still have happened Correct URL/predicate, readiness condition, and resulting application state
Visual assertion toHaveScreenshot() mismatch or timeout The page rendered but did not stabilize to the expected image Fonts, animations, lazy content, viewport, and assertion diff
Capture API failure The screenshot promise rejects or returns no usable bytes Browser, page, permissions, or capture options failed Full exception and the stage at which capture stopped

Playwright explicitly documents that HTTP error responses such as 404 and 503 are still successful responses from an HTTP standpoint: they finish through requestfinished, not requestfailed. Therefore, a logger that listens only for requestfailed will miss many broken pages.

Record evidence that can explain the failure

At the point of failure, retain the complete error message and stack trace, the operation being attempted, the browser and automation-library versions, and the stage reached. Do not catch an exception, return an empty image, and report success: that converts a broken job into a false positive. Rethrow when the caller must know the operation failed.

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.
#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • 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

Network URLs can contain API keys, session identifiers, email addresses, or private query values. Log the URL path and a redacted query string, not credentials, cookies, page contents, or authorization headers. Keep the original diagnostic privately if your security policy permits it, and set a retention period.

Minimal Playwright network logger

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage();

page.on('requestfailed', request => {
  console.error('REQUEST_FAILED', {
    url: redact(request.url()),
    method: request.method(),
    error: request.failure()?.errorText ?? 'unknown'
  });
});

page.on('response', response => {
  if (response.status() >= 400) {
    console.error('HTTP_ERROR', response.status(), redact(response.url()));
  }
});

function redact(raw) {
  const u = new URL(raw);
  for (const key of ['token', 'access_token', 'key', 'password', 'email']) {
    if (u.searchParams.has(key)) u.searchParams.set(key, '[redacted]');
  }
  return u.toString();
}

try {
  await page.goto('https://example.com', { waitUntil: 'domcontentloaded', timeout: 30000 });
  await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
  await browser.close();
}

Attach the logger before navigation or before the click that triggers the request. If you attach it afterward, the event may already have occurred.

Wait for the request you actually need

Register a response wait before triggering the action, and match a specific URL or predicate rather than waiting for any response.

const responsePromise = page.waitForResponse(
  response => response.url().endsWith('/render') && response.request().method() === 'POST',
  { timeout: 30000 }
);
await page.getByRole('button', { name: 'Render' }).click();
const response = await responsePromise;
if (response.status() >= 400) {
  throw new Error(`Render returned HTTP ${response.status()}`);
}
await page.screenshot({ path: 'render.png' });

Use a timeout appropriate to the operation. Puppeteer’s documented waitForResponse default is 30 seconds, and its API allows changing the default or passing zero to disable the timeout. Confirm the behavior against the version installed in your project; defaults are library-version details, not universal guarantees.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • 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 matching response, a visible result, or a selector becoming ready over a fixed delay. Playwright describes page.waitForTimeout() as discouraged in production tests because timer-based synchronization is inherently flaky. A delay can hide a slow page in one run and still be too short in the next.

Diagnose by execution stage

Browser startup

If launch fails before a page exists, verify that the browser is installed, the executable path is valid, the process has permission to start, and the container has required system libraries. Record the browser revision and automation-library version together; mismatched installations are difficult to reproduce.

Navigation and redirects

Log the final URL, redirect chain, and response status. Check for an unexpected login page, a blocked redirect, DNS or TLS errors, proxy authentication, or a navigation timeout. A successful navigation event does not imply a 2xx status, so inspect the response.

Waiting for content

Confirm that the selector belongs to the page you loaded, is not inside a different frame, and is expected under the current account, locale, and feature flags. Replace a broad “network idle” assumption with the precise element or response that proves the page is ready.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • 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.

Frames and handles

After navigation or a frame change, reacquire element and frame handles. A handle created in the old document can become detached even though the selector still exists in the new one.

Request interception

If interception is enabled, every intercepted request must be continued, fulfilled, or aborted exactly once. An unhandled request can make navigation and screenshot waits appear to hang.

Screenshot capture and visual assertions

Puppeteer’s page.screenshot() returns image data through a promise and accepts screenshot options. Keep capture errors separate from network logs so you know whether the page failed to load or the image operation failed. In Playwright Test, toHaveScreenshot() waits for two consecutive screenshots to stabilize before comparing the last one with the expected snapshot. That helps identify visual instability, but it does not tell you whether a network request received an HTTP response.

A timeout is not proof that the action failed

The expected observation may be lost even when the server completed the action. A form submission, payment, email, account creation, or deletion can be processed while the browser waits for a response that never arrives. Before retrying a side-effecting operation, inspect application state or use the service’s idempotency mechanism. Retries are safer for read-only navigation and deterministic screenshot captures than for operations that create or modify data.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • 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

Reduce the problem to a reproducible case

  1. Save the exact operation, URL or selector predicate, timeout, viewport, browser version, and library version.
  2. Remove unrelated test steps while preserving authentication, redirects, frames, and interception behavior.
  3. Run with network failure and HTTP-status logging enabled.
  4. Change one relevant variable: the selector, URL predicate, timeout, proxy, browser path, or wait condition.
  5. Compare a successful run with the failing run, including final URL and status.

Do not “fix” a flaky test by increasing every timeout. A longer limit can be appropriate for a known slow report, but it cannot repair a wrong selector, blocked request, stale frame, or server error.

Common symptoms and targeted fixes

Symptom Likely cause Targeted fix
requestfailed with a network error DNS, TLS, proxy, offline browser, or aborted request Check connectivity and proxy settings; inspect interception and the failure text
Wait times out while the server shows activity Wrong URL predicate, lost response event, or response intercepted Register the wait first, match the actual URL, and log all responses for that host
404/503 but no requestfailed HTTP error response Check response.status() and the redirect/final URL
Selector timeout Wrong page, frame, state, or readiness assumption Capture the current URL and DOM state; wait for the precise condition
Screenshot differs between runs Fonts, animation, lazy loading, time-dependent content, or viewport differences Wait for a stable selector, disable animation where appropriate, and standardize viewport and browser version
Job reports success with an empty result Error was caught and converted into empty data Preserve and rethrow the original exception
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 provides a single screenshot request when you do not need to maintain Playwright or Puppeteer. It accepts the cookie or consent banner as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be disabled. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

Use the API documentation at https://screenshotneo.com/docs/ for authentication and options.

cURL

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(`ScreenshotNeo HTTP ${res.status}`);
require('fs').writeFileSync('shot.webp', Buffer.from(await res.arrayBuffer()));

Every plan includes the same features: full-page and element capture, device and retina settings, PDF output, custom CSS and JavaScript, waits, request blocking, headers and cookies, geolocation, caching, signed links, asynchronous jobs, bulk capture, usage reporting, and an OpenAPI specification. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it.

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

Operational checklist

  • Did you identify whether the failure was transport, HTTP, waiting, rendering, or assertion related?
  • Did you log a redacted URL, failure text or status, operation, versions, and full stack?
  • Was the event listener or response wait registered before the triggering action?
  • Are you using a signal or selector instead of a production fixed sleep?
  • Could the timed-out action have succeeded, making an automatic retry unsafe?
  • Did you test one changed variable in a minimal reproducer?

Frequently Asked Questions

Does an HTTP 500 trigger Playwright requestfailed?

Usually no. A 500 is an HTTP response, so inspect the response status and normal response/request-finished events; requestfailed is for cases where no HTTP response was obtained.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【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.

Should I increase the screenshot timeout first?

No. First verify the URL or selector, frame, interception handling, and readiness signal. Increase a timeout only when the condition is correct but legitimately slow.

Can a screenshot assertion pass while the page request failed?

A visual assertion concerns the rendered image, not every network request. Log the request lifecycle and statuses separately if network success matters.

Is retrying after a timeout safe?

Only when the operation is known to be idempotent or you have checked resulting state. A timeout does not establish that a side effect was not processed.

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

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.