Playwright Interview Questions
Playwright interview questions for QA and SDET roles, with answers to the ones asked most. Then practice with an AI that asks about auto-waiting, test fixtures, browser contexts, API testing, and the patterns that modern Playwright codebases actually use.
A test passes locally but fails in CI about one run in five. Walk me through what you check first, and why.
This single answer is scored on four dimensions: Technical accuracy · Coverage · Clarity · Best practices.
No account needed · Scored in under a minute against a senior rubric
Jump to the 10 Playwright questions
What do interviewers ask about Playwright?
Playwright interviews test your understanding of auto-waiting, browser contexts, fixtures, and the test runner. Expect questions on locator strategies (getByRole, getByText), handling multiple pages and iframes, API request interception, visual comparison testing, and parallelism with test sharding. Companies also ask about migrating from Selenium to Playwright, trace viewer debugging, and integrating Playwright into GitHub Actions or other CI pipelines. Recent releases are fair game too: Playwright 1.64 added a --shuffle flag for randomising test order and locator.within(), and 1.63 added locator.visible().
What the scores show: in 66 scored Playwright test automation mock interviews on AssertHired, concrete examples was the lowest-scoring dimension in 55 of them (83 percent). See where QA candidates lose points.
Learning Playwright properly? Read a free lesson from Playwright Project Pack, or see the course.
What do Playwright interviewers ask at junior, mid and senior level?
The same tool, three different interviews. Find your row before you prepare.
| Level | What interviewers probe | Typical question |
|---|---|---|
| Junior | What interviewers probeAuto-waiting, the locator API and role-based selectors, the difference between page and browser context, and reading a trace. | Typical questionWhy does Playwright not need explicit waits in most cases, and when would you still need one? |
| Mid-level | What interviewers probeFixtures and test isolation, network interception and mocking, authentication state reuse, and structuring a suite with projects. | Typical questionHow would you log in once and share that authenticated state across a whole test run without leaking between tests? |
| Senior | What interviewers probeSharding across CI workers, flake budgets and retries policy, component versus end-to-end coverage, and migrating a Selenium or Cypress estate. | Typical questionYour Playwright suite takes 40 minutes on CI. What would you change first, and how would you prove it helped? |
Which Playwright topics come up most?
Key areas interviewers evaluate when asking about playwright.
Auto-Waiting & Locators
How Playwright's auto-waiting eliminates flakiness and best practices for getByRole, getByText, and getByTestId locators.
Fixtures & Test Isolation
Test fixtures, browser contexts, storage state, and achieving true test isolation without shared state.
Page Object Model
Structuring Playwright tests with POM, fixture-based page objects, and composable test helpers.
API Testing
Using Playwright's request context for API testing, mocking network requests, and contract testing.
Visual Regression
Screenshot comparisons, visual diff thresholds, and managing visual test baselines across environments.
CI/CD & Sharding
Running Playwright in GitHub Actions, test sharding for parallelism, and trace/report artifacts.
What are common Playwright interview questions and answers?
Each answer is the shape of a strong response, not a script to memorise. Read it, then say it out loud in your own words.
- 01Junior
How does Playwright's auto-waiting work? How does it differ from Selenium's explicit waits?
Before an action, Playwright runs actionability checks on the target element and waits until they pass or the timeout runs out. For a click, the element must be visible, stable (not animating), able to receive events (not covered by another element) and enabled. Web-first assertions such as expect(locator).toBeVisible() retry in the same way. In Selenium you write explicit waits yourself with WebDriverWait, so a missing wait is a common cause of flaky tests.
- 02Mid-level
Explain Playwright fixtures. How would you create a custom fixture for an authenticated user session?
A fixture is setup and teardown that a test asks for by name, such as page or request, and you add your own with test.extend. For a signed-in user, log in once in a setup project, save the session with page.context().storageState({ path }), and set storageState in the project config to that file, so every test starts signed in. When each parallel worker needs its own account, make a worker-scoped fixture that logs in and saves its own state.
- 03Junior
What is a browser context in Playwright, and why is it important for test isolation?
A browser context is an isolated session inside one browser, like a fresh incognito profile with its own cookies, local storage and cache. Playwright Test gives every test a new context, so no test can see another test's session, and a context is fast and cheap to create compared with launching a browser. You can also open two contexts in one test to act as two users, such as a buyer and a seller.
- 04Mid-level
How would you intercept and mock API responses in a Playwright test?
Call page.route with a URL pattern and a handler, before the action that sends the request. In the handler, route.fulfill returns your own status and body, so you can test an empty list or a 500 without the backend. route.continue sends the request on, optionally with changed headers, and route.abort fails it. To change a real response, call route.fetch, edit the JSON, and pass the result to route.fulfill.
- 05Senior
Describe your approach to visual regression testing with Playwright. How do you handle cross-platform pixel differences?
Use await expect(page).toHaveScreenshot(). The first run has no baseline, so it fails and writes one, and later runs compare against it. Rendering differs between operating systems and browsers, and the baseline file name carries the project and platform, so create and compare baselines in one environment, usually the official Playwright Docker image in CI. Mask dynamic areas with the mask option, allow small noise with maxDiffPixels or threshold, and leave animations disabled, which is the default.
- 06Senior
How would you set up Playwright test sharding in a CI pipeline to run tests in parallel?
Run npx playwright test --shard=1/4 through --shard=4/4 as four parallel CI jobs, for example with a GitHub Actions matrix. Set the reporter to blob so each shard writes a blob report, and upload those as artifacts. A final job downloads them all and runs npx playwright merge-reports --reporter html on that folder to build one HTML report. Shards split the suite across machines, workers split it across CPU cores on one machine, and you can use both.
- 07
Compare Playwright with Selenium. In what scenarios would you recommend one over the other?
- 08
Playwright 1.64 added a --shuffle flag to the test runner. How would you use it to find tests that depend on running in a particular order?
- 09
Playwright 1.64 added locator.within(). When would you combine two locators, such as a button within a dialog, instead of chaining them?
- 10
Playwright 1.63 added locator.visible() and recommends it over the :visible CSS pseudo-class. Why prefer a locator method to CSS for visibility?
Answers checked against these official sources in November 2026:
Practise these with a scored answer
Go Deeper on Playwright
Practice is free. These are the guides and project packs that turn the answers into working skills.
How does AssertHired help you practice Playwright questions?
Three steps. No fluff. Designed specifically for QA engineers.
Pick Your Focus
Choose from 9 QA interview types, plus a live coding challenge. Select your role, target company, and difficulty level to customize the experience.
Interview with AI
Answer 5 realistic interview questions from an AI that understands QA workflows, test architecture, and engineering culture.
Get Scored
Receive instant feedback scored across 4 dimensions: Technical Accuracy, Communication, Examples, and Depth of Knowledge.
Frequently Asked Questions
What Playwright concepts are most important for interviews?
Focus on auto-waiting, locator strategies (getByRole over CSS), fixtures, browser contexts, API testing, and CI integration. These are the concepts interviewers care about most because they differentiate Playwright from other tools.
Is Playwright experience in demand in 2026?
Yes. On the AssertHired job board, Playwright appeared in 11.5% of postings first seen in the 30 days to 1 November 2026, up from 9.2% in the 30 days before. Selenium appeared in 10.0%, so Playwright now leads. Many teams are migrating from Selenium, and new projects increasingly start with Playwright.
Do I need to know Selenium if I know Playwright?
Understanding Selenium fundamentals is still valuable since many legacy codebases use it, and interviewers often ask comparison questions. However, deep Playwright knowledge alone is sufficient for many modern roles.
Can I practice Playwright interview questions with AI?
Yes. AssertHired's AI interviewer covers Playwright-specific topics including fixtures, auto-waiting, API testing, and framework design. Each session includes 5 questions with contextual follow-ups.
Which Playwright terms should you know?
Concepts interviewers expect you to define alongside Playwright.
How does Playwright compare, and what does the data say?
Side-by-side choices, and original data from scored interviews.
From the Blog
Related guides and tips to help you prepare.
By level
The same tool, asked at the level you are interviewing for.
Companies that test this
Interview guides for companies whose QA loops cover this topic.
More Automation Frameworks Questions
Explore interview questions for related tools in this category.
Explore More Interview Prep Resources
Dive deeper into related QA interview topics.
Free QA career tools, no account needed
Instant and private, everything runs in your browser. Try them before you sign up.
QA Resume Checker
Instant 0-100 score on automation keywords, impact, and ATS formatting.
QA Cover Letter Generator
A tailored 3-paragraph QA cover letter from your resume and a job post.
QA Application Tracker
Drag-and-drop kanban to track every QA application from Applied to Offer.
QA Take-Home Test Generator
A realistic take-home assignment with a scenario, tasks, and a rubric.
QA LinkedIn Headline Generator
A recruiter-searchable headline, About section, and skills list.
QA STAR Story Builder
Structure a QA behavioral answer with the STAR method and instant checks.
QA Bug Report Generator
Build a clean, reproducible bug report for Markdown, Jira, or plain text.
Boundary Value Analysis Generator
Generate boundary value and equivalence partitioning test cases from a range.
QA Metrics Calculator
Calculate DRE, defect leakage, defect density, and pass rate with interpretation.
QA Test Plan Generator
Build a structured test plan (scope, approach, criteria, risks) in Markdown.
QA Salary Calculator
Estimate QA, SDET, and automation tester pay by level, market, and skills.
QA Offer Evaluator
See total comp, a counter range, and a ready-to-send negotiation message.
Ready for Your Playwright Interview?
Practice with AI that knows fixtures, auto-waiting, and test architecture.
Join 700+ QA engineers already practicing with AssertHired.
A test passes locally but fails in CI about one run in five. Walk me through what you check first, and why.
This single answer is scored on four dimensions: Technical accuracy · Coverage · Clarity · Best practices.
Rather skip ahead? Create a free account