October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk7 min

How to Compare Screenshots Across Chromium, Firefox, and WebKit in Playwright

Use Playwright’s screenshot assertion across browser projects, keep baselines tied to each rendering environment, and inspect cross-engine differences separately from regressions.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Playwright Test’s built-in expect(page).toHaveScreenshot() in Chromium, Firefox, and WebKit projects, and keep a separate approved baseline for each browser project and relevant platform. The assertion checks whether a browser’s rendering changed from its own reference; it does not make screenshots from different browser engines identical. For reliable results, capture the same stable page state in the same environment, inspect image diffs, and tune tolerances only after reviewing representative changes.

Configure the browser projects you want to compare

Playwright’s project is named chromium, not Chrome: it runs Playwright’s Chromium build and does not launch branded Google Chrome by default. Likewise, Playwright uses its own Firefox build and WebKit build rather than branded Firefox or Safari. Include all three projects when the goal is to check rendering across browser engines.

As an Amazon Associate I earn from qualifying purchases.

In playwright.config.ts, define projects for the engines you want to test. This minimal configuration uses Playwright’s built-in browser names:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'], browserName: 'chromium' },
    },
    {
      name: 'firefox',
      use: { ...devices['Desktop Firefox'], browserName: 'firefox' },
    },
    {
      name: 'webkit',
      use: { ...devices['Desktop Safari'], browserName: 'webkit' },
    },
  ],
});

The device presets set viewport and related context options; the project’s browserName selects the engine. Choose project names that clearly identify the rendering context, and keep them stable because Playwright uses project names to distinguish snapshots when multiple projects run.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • 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

Add a screenshot assertion and create the first baselines

Write the visual test with Playwright Test’s toHaveScreenshot() assertion. On its first run, Playwright creates the reference image; later runs compare the current screenshot with that reference.

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

test('pricing page visual appearance', async ({ page }) => {
  await page.goto('/pricing');
  await expect(page.getByRole('heading', { name: 'Plans' })).toBeVisible();
  await expect(page).toHaveScreenshot('pricing-page.png', {
    fullPage: true,
  });
});

Run the test in all configured projects, for example with npx playwright test. Playwright generates a separate reference for each project rather than expecting Chromium, Firefox, and WebKit to produce pixel-identical output. Commit the generated baselines, review them, and treat later baseline changes like code changes: inspect the visual difference and approve only intentional updates.

To refresh references after verifying a deliberate UI change, use npx playwright test --update-snapshots. Avoid using snapshot updates as a way to silence an unexplained failure.

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

Keep browser and platform baselines separate

Rendering can vary by browser and platform, including fonts. Keep distinct references for each browser project and for platform contexts that produce materially different output. If your CI baseline is generated on Linux, compare against Linux in CI rather than casually regenerating it on a developer’s macOS machine.

Microsoft Playwright documentation warns that output can depend on host OS, browser version, settings, hardware, power source, headless mode, and other factors. Use the same environment for baseline creation and comparison wherever practical: operating system or container image, Playwright version and browser builds, viewport, device scale factor, browser settings, and headless mode. When one of these changes, expect possible diffs and review them rather than assuming the application changed.

Stabilize the page before capturing

A screenshot assertion is only useful when the page is in the intended state and its changing elements are controlled. Navigate to the state being tested, wait for meaningful UI readiness, and use deterministic data. A fixed delay may be appropriate for a known transition, but prefer a locator or application condition when it expresses the state more directly.

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.
  • Wait for the intended content: assert that a heading, result, or loading indicator has reached the expected state before capturing.
  • Use stable fixtures: freeze or seed data that changes with time, random values, accounts, or server responses.
  • Handle animation and caret effects: Playwright’s screenshot assertion disables animations and hides the caret by default. Avoid adding redundant workarounds unless the test’s purpose specifically includes those effects.
  • Normalize volatile areas: use screenshot styles to hide or neutralize timestamps, rotating promotions, or other regions irrelevant to the visual contract. Playwright supports custom screenshot styles, including filtering elements such as iframes.
  • Choose capture scope intentionally: a full-page capture covers content beyond the viewport but may include more dynamic page regions; a locator screenshot can limit the assertion to a component.

Example of hiding a timestamp only for the screenshot:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await expect(page).toHaveScreenshot('dashboard.png', {
  fullPage: true,
  style: `
    .last-updated,
    .rotating-promo {
      visibility: hidden !important;
    }
  `,
});

Keep the normalization narrow. Hiding an entire region that contains important layout or content can conceal a real regression.

Set comparison tolerance without masking defects

Playwright’s screenshot matcher offers color-difference sensitivity and limits on the amount of changed image area. Its documented default YIQ color-difference threshold is 0.2; this is an API default, not a universal recommendation for every project. You can set maxDiffPixels or maxDiffPixelRatio to allow a bounded number or proportion of differing pixels.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • 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
await expect(page).toHaveScreenshot('pricing-page.png', {
  fullPage: true,
  threshold: 0.2,
  maxDiffPixelRatio: 0.001,
});

Use tolerance to account for known, acceptable rendering variation—not to make a failing test pass without understanding it. Start with defaults, inspect expected, actual, and diff images, and then adjust one setting at a time based on representative results. A more permissive threshold may suppress harmless antialiasing differences, but a broad changed-area allowance can hide a shifted button, missing border, or other meaningful defect. The appropriate values depend on the visual precision your test needs.

Keep screenshot scale consistent

Screenshot scale affects pixel dimensions and therefore comparison results. With CSS scale, an output pixel corresponds to a CSS pixel; with device scale, output pixels correspond to device pixels, producing larger images on high-DPI contexts. Keep device scale factor and screenshot scale consistent between baseline generation and comparison. If you change either, review and regenerate affected references intentionally.

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

Read failures as two different kinds of comparison

Cross-browser visual work has two related but distinct goals:

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.
  • Regression checking: compare Chromium with its approved Chromium reference, Firefox with its Firefox reference, and WebKit with its WebKit reference. This asks whether a particular engine’s rendering changed.
  • Compatibility checking: inspect screenshots from different engines side by side to find differences between them. This asks whether the product behaves acceptably across browsers.

Separate baselines are necessary for regression checking because engines render differently. They do not, on their own, tell you whether an intentional difference between engines is acceptable. If compatibility is the goal, review the engine outputs against one another as well as each engine against its own baseline.

When an assertion fails, inspect the expected, actual, and difference images. Determine whether the cause is an intended design change, an environment shift, nondeterministic content, or a genuine regression. Update only the affected reference after that decision.

What Playwright’s browser names mean for Safari coverage

Playwright WebKit is derived from upstream WebKit and can contain changes before they reach Safari or other WebKit-based browsers. It is not the branded Safari app. Playwright’s Firefox is also a Playwright build that tracks recent Firefox Stable and includes Playwright patches; it is not branded Firefox.

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

For a closer-to-Safari experience in cases such as video playback, Playwright documentation suggests using WebKit on macOS. If a requirement specifically depends on branded Safari behavior, a WebKit project should not be described as proof that Safari itself was tested.

Troubleshoot common visual comparison failures

  • Every browser fails after a CI image change: the OS, fonts, browser build, or another environment input may have changed. Restore the baseline environment or review and intentionally regenerate baselines in the new controlled environment.
  • Only one browser project fails: inspect that project’s actual and diff images first. The issue may be an engine-specific rendering change or a browser-specific application defect; do not copy another project’s baseline over it.
  • The image changes between identical runs: look for timestamps, random content, animation, asynchronous data, or other moving regions. Wait for the intended state and stabilize or narrowly mask volatile content.
  • The page is blank or incomplete: verify navigation and the readiness condition before asserting the screenshot. A screenshot taken before the page’s meaningful content is ready can create misleading diffs.
  • Diffs are consistently larger than expected: verify viewport, device scale factor, capture scale, and full-page versus viewport scope. Then inspect the image pair before considering tolerance changes.
  • Updating snapshots does not solve the underlying issue: updating replaces the approved reference; it does not diagnose why output changed. Use it only after confirming the new rendering is intended.

Or skip the browser setup

If your goal is a one-off website capture rather than a Playwright visual regression test, ScreenshotNeo returns a screenshot or PDF from one GET request. It is a screenshot API and MCP server, not a replacement for per-engine Playwright baselines.

With an API key, this cURL example saves a WebP screenshot of the target page. See the ScreenshotNeo API documentation for request options 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

ScreenshotNeo removes supported cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000 shots. Sign up for the free plan.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.