Complete guide
Visual regression testing: the complete guide for website teams
What visual regression testing is, how pixel and DOM comparison work, how to choose baselines, which tools to use and how to review changes before and after release.
Visual regression testing compares a new rendering of a page with a trusted earlier version, called a baseline. It catches layout, style, image and content changes that functional tests miss, because a page can still technically work while looking broken to customers.
What is visual regression testing?
A visual regression is an unintended change in how an interface looks: a button that slipped below the fold, a font that failed to load, a translated label that overflows its container. Visual regression testing captures screenshots of pages or components, compares them with approved baselines and flags the differences for a person to review. The “regression” part matters: the goal is to catch things that used to look right and no longer do.
What visual regression testing detects
A visual comparison can reveal shifted layouts, missing images, incorrect fonts, clipped translations, hidden controls and responsive breakpoints that no longer behave as intended. It complements functional and accessibility testing; it does not replace either.
- Layout and spacing changes
- Typography, color and image changes
- Responsive and localized overflow
- Unexpected production content changes
How visual comparison works: pixel, perceptual and DOM diffs
Pixel comparison checks every pixel against the baseline and highlights the areas that differ; it is precise but sensitive to anti-aliasing and font rendering. Perceptual or AI-assisted comparison tries to ignore differences a person would not notice. DOM and content comparison inspects the underlying text and structure, which explains why something changed rather than only where. Mature workflows pair a visual diff with content comparison so reviewers see both the picture and the cause.
- Pixel diff: exact, needs a stable environment
- Thresholds: tolerate tiny rendering noise
- Masking: ignore regions that change by design
- Content diff: see which text or element changed
Build the right test inventory
Start with business-critical templates rather than every URL. Include the homepage, conversion paths, high-traffic landing pages, representative content templates and pages with complex responsive behavior. A crawler or sitemap can reveal coverage gaps before you select what deserves continuous monitoring.
Choose a baseline strategy
A baseline is the version you trust. Rolling baselines are convenient for frequent releases, while protected baselines are useful for important campaigns or reference designs. Whichever strategy you choose, record why an intentional change was accepted so the next reviewer has context.
Reduce noisy comparisons
Use consistent viewports, fonts, data and interaction steps. Wait for meaningful content, hide or ignore truly dynamic regions, and keep cookie banners or accordions in a predictable state. Do not increase thresholds until real regressions disappear; stabilize the page first.
- Dismiss cookie banners and chat widgets consistently
- Freeze or mask dates, counters and carousels
- Disable animations before capturing
- Wait for fonts and lazy-loaded images
Where visual tests run: CI pipeline or production
Code-first tools run visual tests in CI on every pull request, usually through Playwright, Cypress, Storybook or Selenium. That catches regressions a developer introduced. Production monitoring captures the live site on a schedule, which also catches changes made through a CMS, a third-party script, an A/B test or an expired asset — none of which pass through a pull request. Many teams need both; the right starting point depends on where most of your unexpected changes come from.
Choosing a visual regression testing tool
Open-source options such as Playwright screenshot assertions and BackstopJS are free but leave baselines, storage, review and flakiness to you. Hosted platforms such as Percy, Applitools and Chromatic add review workflows around CI builds. VisualRunner starts from the website instead: it discovers your pages, captures them across languages and viewports, and monitors production without a test repository. Our tool roundup compares the main options in more depth.
A repeatable review workflow
Capture, compare, inspect and classify. Review the new image beside the baseline, inspect highlighted areas, confirm whether the change was expected, and either approve it or create an issue. Preserve the capture history so regressions can be traced to the release where they appeared.
Questions
Frequently asked questions
Is visual regression testing the same as screenshot testing?
Screenshot testing is the capture-and-compare technique. Visual regression testing adds baselines, repeatability and a review decision to determine whether a difference is intentional.
What is the difference between visual testing and functional testing?
Functional tests check that behavior works — a form submits, a link navigates. Visual tests check that the page looks right. A checkout button can pass every functional test while being hidden behind a banner.
Can visual regression testing be done without code?
Yes. Code-first tools need a test suite, but platforms like VisualRunner capture pages from a URL list, sitemap or crawl and compare them on a schedule without writing tests.
What pages should be tested first?
Begin with conversion paths, shared templates, high-traffic pages and layouts that change significantly across languages or viewports.
Should every pixel difference fail a release?
No. Differences should trigger review. Teams need to distinguish intentional design changes and harmless rendering noise from genuine regressions.
Continue exploring
Related resources
Turn the checklist into a repeatable workflow
Discover your pages, capture the important states and keep a visual history of every meaningful change.
Start free trial