Skip to main content

What is visual regression testing and how would you implement it?

  • visual testing
  • screenshot comparison
  • UI testing

Answer it first, then compare. Nothing here is saved or scored.

Model answer

Visual regression captures screenshots of UI components or pages and compares them against approved baselines, pixel-by-pixel or perceptually. Tools: Playwright's `toHaveScreenshot()`, Percy, Chromatic, BackstopJS. Implementation: capture baselines in CI, compare on PR, review diffs in a visual dashboard. Challenges: dynamic content (mask timestamps, ads), responsive breakpoints (test multiple viewports), and managing baseline updates when UI intentionally changes.

What interviewers listen for

  • Test architecture instincts
    You can defend why your suite is shaped like a pyramid, a trophy, or a honeycomb.
  • Locator discipline
    You rank selector strategies by stability and explain when to break the rule.
  • Flaky test ownership
    You debug to a structural fix instead of retry-until-green.
  • Parallelisation literacy
    You know how your framework isolates state, fixtures, and database access across workers.

See all 35 automation questions

Written by , Senior QA Automation Engineer, 50+ QA candidate interviews conductedLast updated July 2026