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

If a Playwright snapshot seems to be missing in UI Mode, first run the exact test and snapshot assertion that should create it. For a missing visual baseline, run npx playwright test --update-snapshots=missing, then check the test result, active project and configured snapshot path. UI Mode helps you select, run and inspect tests; opening it alone does not generate snapshots.

First identify what kind of snapshot is missing

“Snapshot” can mean different artifacts in Playwright, and the fix depends on which assertion the test uses. Find the assertion in the test before changing update settings or looking for files:

  • expect(page).toHaveScreenshot() compares a rendered page or element with a visual image baseline.
  • toMatchAriaSnapshot() compares an accessibility-tree representation. Playwright documents its generation and update workflow separately.
  • toMatchSnapshot() compares a serialized value, such as text or other data; its output is not necessarily an image.

Visual screenshot baselines are typically image files stored in a snapshot directory. ARIA and value snapshots have their own formats and may have different path or update behavior. The [visual comparisons documentation], [ARIA snapshot documentation] and [PageAssertions API] describe these distinctions. Do not use screenshot-specific file expectations to diagnose a missing accessibility or text snapshot.

Run the selected test in UI Mode

Start UI Mode from the project directory with:

npx playwright test --ui

In the interface, select the test that contains the relevant snapshot assertion, choose the intended project, and run the test. UI Mode is an interactive interface for exploring, running and debugging tests. Merely opening the interface—or selecting a test without running it—does not execute the assertion that creates its baseline. The [UI Mode guide] explains its test selection, run controls, attachments and inspection features.

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

If several projects are configured, verify which one you are running. A test may pass in one browser project and still have no baseline for another project’s rendering environment. Use the test result and attachments to establish whether the assertion actually ran, rather than treating the presence of UI Mode as proof that snapshot generation took place.

Create only the missing visual baselines

When the missing artifact is a visual baseline, you can use the Playwright CLI to update missing snapshots explicitly:

npx playwright test --update-snapshots=missing

This command runs tests and writes baselines that are missing. Inspect the run’s result: on an initial visual comparison, Playwright can report the missing baseline as an error while writing the actual image. A reported failure in that situation does not by itself mean the file was not created. Check the output path and review the generated image before accepting it.

The CLI distinguishes update modes. A normal test run defaults to the missing mode, while supplying the update flag without a value defaults to changed. Use the explicit =missing form when you intend to create absent references without intentionally refreshing existing ones. Other documented modes include all, changed and none; all refreshes every snapshot, so do not choose it merely to fix one absent file. Consult the [command-line documentation] matching your installed Playwright version if behavior or defaults differ.

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.

For a targeted run, combine the update option with the test selection syntax appropriate to your project. For example, if the test is in tests/profile.spec.ts, run:

npx playwright test tests/profile.spec.ts --update-snapshots=missing

That command still runs the selected test file, so make sure it contains the assertion whose baseline you need. If the file has multiple tests, inspect the run output and use UI Mode or the CLI’s test selection options to narrow down the specific test. The snapshot update option does not manufacture a reference for an assertion that never executes.

Find the actual snapshot destination

For visual comparisons, the default expectation is a directory based on the test filename, ending in -snapshots. Filenames can include browser or platform identifiers. A baseline can therefore exist under a name or location different from the one you expected.

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

Inspect the active Playwright configuration, including any project-specific configuration and snapshotPathTemplate. Playwright also documents snapshotDir as a project setting. Either the default naming convention or a customized destination can explain why a generated file is not beside the test or in a guessed folder. See the [TestProject API documentation] for project configuration and the visual comparison guide for default snapshot locations and naming.

When searching for the output, use the exact test name, project and browser from the run. Check whether the test filename’s snapshot directory was created, and whether a custom template changes the path. A file written for one project or browser should not automatically be treated as the expected baseline for another.

Use UI Mode to inspect what happened

After running the test, inspect its result in UI Mode rather than relying only on a file search. Depending on the test result, the interface can show attachments, expected/actual/diff images, the action timeline and metadata. These provide evidence about what the test executed and what the visual comparison produced.

  • Confirm the selected test and project are the ones you intended.
  • Check whether the assertion ran and whether the result reports a missing reference, a mismatch, or another failure.
  • Open available expected, actual and diff images to distinguish “no baseline yet” from “baseline exists but differs.”
  • Use the run’s metadata and project details when checking browser or rendering context.

UI Mode is an inspection aid, not a guarantee that all snapshot kinds have been generated. A visible actual image can help you understand a comparison, but it does not eliminate the need to verify the assertion, update mode and destination.

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

Diagnose rendering and environment differences

A screenshot baseline is tied to rendered output. Playwright’s visual comparison documentation notes that rendering can vary with operating system, browser version, settings, hardware, power source and headless mode. If a test runs in a different environment from the one that produced the reference, output may differ or a project-specific reference may be expected.

For more reliable comparisons, run the test in the project and environment intended to own the baseline. Check the browser project and platform-specific filename, and avoid updating references until you have established that the new rendering is the intended result. A difference image is useful evidence, but a changed image is not automatically a correct new baseline.

Review updates before committing them

Generated references become part of what future test runs regard as expected behavior. Review a new or changed image against the intended page state before committing it; do not treat a passing run after an update as proof that the reference is correct.

ARIA snapshot updates have a distinct review flow: Playwright documents patch files that can be reviewed and applied. Follow that workflow for ARIA snapshots rather than expecting a screenshot image or applying screenshot-only advice. See the [ARIA snapshot guide].

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

Troubleshooting by symptom

Symptom Likely cause What to do
No file appears after opening UI Mode The test or relevant assertion was not run. Select and run the exact test, then inspect its result and attachments.
The test reports a missing screenshot but the file is hard to find The default snapshot directory, project/browser suffix or configured destination differs from your assumption. Check the test’s -snapshots directory, active project and snapshotPathTemplate or snapshotDir configuration.
Existing baselines changed unexpectedly The update mode may have been omitted or set to a broader mode than intended. Use --update-snapshots=missing when only missing references should be created; inspect changes before retaining them.
A baseline exists but the visual comparison fails The current rendering may differ, or the test may be using a different browser, platform or project. Inspect expected, actual and diff images; verify the environment and intended page state before updating.
The missing artifact is not an image The assertion may be an ARIA or value snapshot rather than toHaveScreenshot(). Use the workflow and output format for the assertion actually in the test.
ARIA snapshot generation times out Generation or assertion exceeded the configured expect timeout. Check the ARIA snapshot assertion and configured expect timeout; adjust the timeout when appropriate.

Or skip the browser setup

ScreenshotNeo is a website screenshot API, not a Playwright test runner or a way to create a toHaveScreenshot() baseline inside your test suite. It can be useful when your separate task is simply to capture a URL as an image or PDF. One GET request returns a screenshot; see the ScreenshotNeo API documentation for parameters and response details.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

  • Cookie/consent banners, newsletter popups and chat widgets are removed before the shot; each step can be turned off.
  • Bot checks/CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and responses indicate the page verdict and billing status.
  • An MCP server provides take_screenshot, get_page_info and capture_pdf tools for AI agents.
  • The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to try it without a card.

Frequently Asked Questions

Does UI Mode create every missing snapshot as soon as I open it?

No. UI Mode opens the interactive test interface; the test containing the assertion must run for that assertion to produce a snapshot.

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.

Should I use –update-snapshots=all to fix one missing image?

No. The explicit missing mode targets absent baselines; all refreshes every snapshot.

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.