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

Playwright’s HTML reporter gives you a searchable view of test status, browsers, durations, errors, steps and artifacts. To make screenshots useful in that report, configure screenshot capture or tracing, run the suite with the HTML reporter, retain the report directory in CI, and open failures through the report’s trace and attachment links.

The shortest local workflow is:

npx playwright test --reporter=html
npx playwright show-report

What a Playwright HTML report shows

An HTML report is an interactive record of a test run rather than a folder of image files. It lists the tests that ran, the browser project used, each test’s duration and its final state. You can filter for passed, failed, flaky or skipped tests and search for a test by name.

Opening a test exposes its error, individual steps and links to available traces or attachments. For screenshot-driven diagnosis, always read the artifact in context: a screenshot without the browser, retry and timing information may show what the page looked like but not why it reached that state.

Report axis What it can tell you
Status Whether the test passed, failed, was flaky after retries, or was skipped.
Browser/project Whether the problem is specific to Chromium, Firefox, WebKit or a project configuration.
Duration Whether a slow or timing-sensitive step coincides with the failure.
Retry state Whether the failure reproduced on a retry or only occurred on the first attempt.
Artifacts Whether the result includes a trace, screenshot, video or visual-diff attachment.

Generate and open the report locally

Run with the HTML reporter

From the project directory, run:

npx playwright test --reporter=html

Playwright writes the report to its generated report directory. Start the local report server with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npx playwright show-report

The command opens the report for inspection. If the browser does not open automatically, copy the local address printed by the command into a browser.

Set the reporter in configuration

For a repeatable command, set the reporter in playwright.config.ts:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [['html', { open: 'never' }]],
});

Using open: 'never' prevents a local browser from opening during automated runs. You can still inspect the result later with npx playwright show-report.

Make screenshots and traces available

Use tracing for an interactive film strip

Playwright tracing with screenshots enabled records a screencast for each trace. In the report, the trace appears as a film strip. Hovering over the strip magnifies an image for an action or state, which helps you locate the point where the test diverged.

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

A practical default for CI is to collect a trace on the first retry:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  retries: 2,
  use: {
    trace: 'on-first-retry',
  },
});

With two retries configured, a trace is recorded when a test is retried for the first time. This keeps ordinary successful runs lighter while preserving diagnostic context for an intermittent failure.

Keep traces for failures when retries are not used

If your project does not retry tests, use retain-on-failure:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  use: {
    trace: 'retain-on-failure',
  },
});

This preserves traces for failed tests without recording a trace for every successful test.

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

Record every test only for targeted debugging

trace: 'on' records every test. It provides the most complete evidence, but tracing all tests is performance-heavy and creates more artifacts. Enable it temporarily for a focused investigation, then return to on-first-retry or retain-on-failure.

Attach explicit screenshots

Traces provide a timeline, but a standalone screenshot can be easier to consume in a CI artifact or pull request. Capture one at a meaningful checkpoint:

import { test, expect } from '@playwright/test';

test('checkout summary', async ({ page }, testInfo) => {
  await page.goto('https://example.com/checkout');
  await expect(page.getByRole('heading', { name: 'Order summary' })).toBeVisible();

  const image = await page.screenshot({ fullPage: true });
  await testInfo.attach('checkout-summary', {
    body: image,
    contentType: 'image/png',
  });
});

The attachment is shown with the test’s other artifacts. Use a stable checkpoint—after navigation, after a form submission or immediately before an assertion—rather than taking screenshots after every action.

Inspect a failed test in the report

  1. Open the report with npx playwright show-report.
  2. Filter to Failed or Flaky, then select the test.
  3. Read the assertion error and expand the test steps to identify the first unexpected state.
  4. Open the screenshot attachment, if present, and compare it with the expected UI state.
  5. Open the trace link or the test’s Traces tab.
  6. Move through the trace timeline and inspect the before, action and after snapshots around the failing step.
  7. Check the locator and source location, logs, network requests, console output, browser, viewport and other metadata.
  8. For a visual assertion, compare the expected, actual and diff screenshots before changing the test or baseline.

Trace Viewer is a GUI tool for exploring recorded Playwright traces after the script has run. The timeline is important: a final screenshot may look correct even when an earlier navigation, request or locator action caused the eventual failure.

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

Configure a CI workflow that keeps artifacts

Run the suite and preserve the report directory

CI must retain both the HTML report and the trace or screenshot files it references. A generic sequence is:

npx playwright install --with-deps
npx playwright test --reporter=html

Configure your CI provider to upload the generated Playwright report directory as an artifact even when tests fail. Uploading only the HTML file breaks links to traces and images because those files live alongside the report.

Open an archived report

Download the complete artifact into a workspace, then run:

npx playwright show-report path/to/playwright-report

Keep the directory structure unchanged. If your CI system extracts files into a different location, pass that location to show-report.

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.

Choose an artifact policy

  • Routine CI: use trace: 'on-first-retry' with retries, or retain-on-failure without retries.
  • Visual investigation: add explicit screenshots at the assertion boundary and preserve expected, actual and diff images.
  • Deep, short-lived diagnosis: switch to trace: 'on' for the affected project or test scope, then disable it after the issue is understood.

Use screenshots to classify the failure

Browser-specific failure

Run the same test across the configured browser projects and compare the browser metadata and screenshots. A failure in one engine with identical test data points toward rendering, feature support or timing differences rather than a universal application defect.

Timing or readiness failure

Compare durations, the action timeline and before/after snapshots. If the screenshot shows a loading state, inspect network requests and console output in the trace before adding a longer timeout. Prefer waiting for a meaningful selector or application state.

Non-reproducible failure

Compare the first attempt with the retry. A passing retry plus a failure-only trace is evidence of flakiness, but it does not identify the cause by itself. Use the trace’s request, console and locator details to determine whether the issue is data, network, synchronization or environment related.

Visual regression

Inspect expected, actual and diff images together. Confirm that viewport, browser, device scale, fonts and test data are the same before updating a baseline. A changed screenshot is not automatically a product bug or a valid new baseline.

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.

Common errors and fixes

“No report found” or an empty report

Cause: the test command used a different reporter, no tests matched the command, or the report directory was removed.

Fix: run npx playwright test --reporter=html, verify that tests execute, and open the resulting directory with npx playwright show-report.

The report opens but screenshots or traces are missing

Cause: CI uploaded only the HTML file, or tracing and attachments were never enabled.

Fix: upload the entire report directory and configure trace: 'on-first-retry', retain-on-failure or an explicit testInfo.attach screenshot.

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

A trace link returns a missing-file error

Cause: the artifact was flattened, renamed or partially copied.

Fix: preserve the generated directory hierarchy when uploading and extracting artifacts.

The screenshot shows a blank page

Cause: navigation had not completed, a request failed, a bot check blocked the page, or the screenshot was taken before the relevant selector appeared.

Fix: inspect network and console panels in the trace, wait for a specific selector or application state, and verify that the CI environment can reach the target service.

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

Artifacts are too large or the run is slow

Cause: tracing every test, full-page images and repeated video-like captures generate substantial data.

Fix: use failure-oriented trace policies, capture only diagnostic checkpoints, and enable full tracing only for a targeted run.

A visual diff changes on every run

Cause: nondeterministic data, animations, fonts, viewport differences or asynchronous content.

Fix: stabilize test data and environment first, then inspect the trace and diff. Do not accept a new baseline until the cause of the variation is understood.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability and cost considerations

Tracing and screenshots trade storage and runtime overhead for diagnostic detail. Recording every test gives maximum context but is heavier than recording only retries or failures. Full-page screenshots are useful for layout defects but are larger than a cropped element image. In CI, artifact retention limits also matter: an expired or incomplete artifact makes a previously useful report impossible to inspect.

Reliability improves when the report, traces, screenshots and test metadata are retained as one artifact set. Keep the browser project, viewport and retry policy visible in the report so a later reader can distinguish an environment problem from an application problem.

Or skip the browser setup

If you need a clean screenshot of a website rather than a test trace, ScreenshotNeo returns an image or PDF from one HTTP request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing result.

Use the API documentation at https://screenshotneo.com/docs/ for authentication and options. A minimal cURL request is:

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)
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}`);

For AI-assisted workflows, its MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients. It also supports full-page captures with lazy images loaded, CSS-selector element capture, dark mode, device presets and custom viewports, retina scale, PDF paper and page options, custom CSS and JavaScript, clicks, selector or network-idle waits, request blocking, headers, cookies, user agents, authorization, timezone, 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. Parameter names used by other screenshot APIs also work.

Plans include 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000 screenshots. Every feature is on every plan. Sign up for the free ScreenshotNeo plan to try it.

FAQ

Can an HTML report contain screenshots without traces?

Yes. Attach screenshots with testInfo.attach or use Playwright’s screenshot assertions. Traces add a timeline and diagnostic panels but are not required for an image attachment.

Should I record a trace on every retry?

The usual choice is on-first-retry, which captures the first retry while limiting overhead. Use retain-on-failure when retries are disabled, and reserve on for focused debugging.

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

Why can a test pass while its screenshot looks wrong?

A functional assertion may not check visual appearance. Add an explicit visual assertion or inspect the attached image at a defined checkpoint, then use expected, actual and diff artifacts to evaluate the change.

Frequently Asked Questions

Can an HTML report contain screenshots without traces?

Yes. Attach screenshots with testInfo.attach or use Playwright’s screenshot assertions. Traces add a timeline and diagnostic panels but are not required for an image attachment.

Should I record a trace on every retry?

The usual choice is on-first-retry, which captures the first retry while limiting overhead. Use retain-on-failure when retries are disabled, and reserve on for focused debugging.

Why can a test pass while its screenshot looks wrong?

A functional assertion may not check visual appearance. Add an explicit visual assertion or inspect the attached image at a defined checkpoint, then use expected, actual and diff artifacts to evaluate the change.

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.