Playwright Interview Questions for SDET 2026
Master Playwright interview questions for SDET 2026: auto-waiting vs Selenium, browser contexts, semantic locators, network interception, API testing with request context, visual comparison, Trace Viewer debugging, mobile emulation, fixtures, Playwright vs Cypress. Mitchell Agoma's perspective from HMRC, MoD, Nationwide, Accenture, Asda, Co-op, and BT.
Published 27 June 2026 • By Mitchell Agoma
It is 11:08pm. You have been reading the job specification for 41 minutes — the one from the payments platform offering £92,000 for a Senior SDET. You have scrolled past TypeScript, CI/CD pipelines, contract testing, and microservices — all of it territory you have navigated in Selenium for the last four years. And then you hit the sentence that makes your stomach drop: 'Strong experience with Playwright — including browser contexts, network interception, auto-waiting patterns, and visual comparison testing.' You have built Selenium frameworks. You have wrestled with WebDriver waits, ChromeDriver versions, and StaleElementReferenceExceptions at 2am. But Playwright? You have seen the blog posts. You have watched the conference talks. You know it is the framework everyone is migrating to. But you have never opened a Playwright test file. You have never written a page.getByRole('button', { name: 'Submit' }) locator. You have never configured a browserContext with geolocation and permission overrides. You have never used route.fulfill() to mock an API response or expect(page).toHaveScreenshot() for visual regression. And now, at 11:08pm, four days before the interview, you are realising that Selenium fluency alone is no longer enough. The panel is going to ask Playwright-specific questions — about locator strategies, about test isolation, about the auto-waiting mechanism that makes Playwright fundamentally different from every framework you have used — and you cannot bluff your way through a framework architecture discussion.
Mitchell has interviewed over 200 SDET candidates across 20 years at HMRC, the Ministry of Defence, Nationwide, Accenture, Asda, Co-op, and BT — and the Playwright question is where experienced Selenium automation engineers lose offers they were otherwise qualified to win. They can discuss the Page Object Model. They can explain implicit vs explicit waits in Selenium. They can describe how they parallelise tests with TestNG and Selenium Grid. But when the panel asks — 'Walk me through how Playwright's auto-waiting mechanism works — not just that actions wait for elements to be actionable, but what specific readiness checks Playwright performs before each action, how web-first assertions retry automatically, and how this changes your test design compared to Selenium where you had to write explicit waits for every async interaction' — the answer collapses. The candidate describes what Playwright does ("it waits automatically") but cannot explain how it does it or why that changes the entire test-design philosophy. The gap between 'I have read about Playwright' and 'I understand Playwright's architecture well enough to explain how auto-waiting, browser contexts, and network interception combine to eliminate the categories of flakiness that plague Selenium suites' is the gap that separates the £55,000 automation tester from the £95,000 SDET in 2026.
Here is the hard truth that keeps Mitchell's SDET candidates awake — and it should keep you awake: in 2026, Playwright is not 'the new Selenium.' It is the framework that exposes why Selenium's architecture — WebDriver protocol overhead, separate browser-driver processes, no built-in auto-waiting, no network interception, no browser contexts — produces flaky tests as a design outcome, not a QA failure. Microsoft, Google, and the Playwright team have invested five years of browser-engine-level engineering — Chromium, Firefox, and WebKit developers working together to expose browser DevTools protocols directly to test automation, bypassing the WebDriver JSON wire protocol entirely. The result: Playwright communicates with browsers through the same DevTools protocol that Chrome DevTools uses — not through a separate driver binary that translates HTTP commands to browser internals. This is not a marginal improvement. It is the architectural difference that makes Playwright tests 2-3x faster than Selenium, eliminates the flakiness categories that consume 30-40% of Selenium maintenance time, and enables capabilities — network interception, geolocation mocking, browser-context-level authentication, multi-tab and multi-origin testing — that Selenium either cannot do or can only do through fragile workarounds. The Selenium-only SDET in 2026 is not unemployable — but they are competing against candidates who can discuss Playwright's architecture with the same depth that the panel expects for API testing or CI/CD strategy. And the window for transitioning while the market still rewards 'experience with both Selenium and Playwright' rather than expecting 'Playwright as primary framework' is closing.
The SDET Interview Coach iOS app — with 800+ questions across 32 topics, Claude-graded mock interviews from Junior to Lead, and dedicated modules on Playwright framework architecture, locator strategies, network interception, and visual testing — gives you the structured practice to discuss Playwright with the depth the panel is actually listening for, at £4.99 per month on iOS. And if you are building your broader SDET toolkit, the AI Test Automation Playbook (£9.99) includes a dedicated section on Playwright — covering browser contexts, auto-waiting, network mocking, API testing with request context, visual comparison, and how AI tools accelerate Playwright test generation and maintenance. Do not let 'explain how Playwright's auto-waiting works' be the question that exposes the gap between your Selenium experience and the modern framework architecture the panel is hiring for. Understand the framework. Walk in ready.
What Interviewers Are Actually Testing When They Ask About Playwright — It Is Never 'Can You Write a Test?'
Any SDET with two weeks of Playwright practice can write a login test. The panel knows this. When they ask about Playwright, they are probing four signals that separate candidates who have used Playwright from candidates who understand Playwright:
Signal 1: You Understand Why Playwright's Architecture Eliminates Flakiness — Not Just That It Does
The candidate who says 'Playwright has auto-waiting so tests are less flaky' is in the bottom quartile of applicants. The candidate who explains that Playwright communicates with browsers through the Chrome DevTools Protocol — bypassing the WebDriver JSON wire protocol entirely, eliminating the network-hop latency and serialisation overhead that causes Selenium's element-not-found and stale-element failures — and that each action (click, fill, selectOption) runs a series of actionability checks (element is attached to DOM, visible, stable — not animating, receives events — not obscured by another element, enabled — not disabled) before performing the action, and that web-first assertions (expect(locator).toBeVisible(), expect(locator).toHaveText()) retry automatically with a configurable timeout — is in the top quartile. At HMRC, Mitchell watched a team migrate a 300-test Selenium suite to Playwright. The Selenium suite had a 40% flakiness rate — 120 tests failed randomly every run. The root causes: race conditions between Selenium actions and JavaScript-rendered UI updates, StaleElementReferenceExceptions when the DOM re-rendered between element location and interaction, and WebDriver command timeouts during authentication redirects. The same tests, rewritten in Playwright with auto-waiting and web-first assertions, had a 2% flakiness rate. The difference was not better test code — it was a fundamentally different communication architecture between the test runner and the browser. The interviewer wants to hear that you understand the architectural root cause of flakiness — not just the symptom.
Signal 2: You Design Tests Around Browser Contexts — Not Browser Instances
The candidate who says 'Playwright runs tests in parallel by opening multiple browsers' has missed the single most important architectural concept in Playwright. Playwright does not parallelise by launching multiple browser instances — it parallelises by creating multiple browserContext objects within a single browser instance. A browser context is an isolated browsing session — with its own cookies, localStorage, sessionStorage, cache, and network state — that shares the browser process. Creating a browser context takes ~10ms and uses ~2MB of memory. Creating a new browser instance takes ~500ms and uses ~200MB of memory. This is why Playwright can run 10 tests in parallel on a developer's laptop while Selenium Grid would need 10 browser instances across 3 machines. At Nationwide, Mitchell's team reduced their test execution time from 47 minutes (Selenium, 5 parallel sessions on a dedicated grid server) to 8 minutes (Playwright, 15 parallel browser contexts on a single CI runner). The interviewer is testing whether you understand browser contexts as an architectural primitive — not a configuration setting. The candidate who can explain that browser contexts enable isolated authentication states (log in once per context, not once per test), persistent vs non-persistent contexts (geolocation, permissions, and timezone overrides), and test-level isolation without the overhead of browser restarts is demonstrating framework architecture understanding — not tool familiarity.
Signal 3: You Use Network Interception as a Testing Primitive — Not a Debugging Hack
The Selenium approach to testing a flow that depends on an API response: run the API, seed the test data, hope the API is available, handle the 5-second timeout when it is not, and rebuild the entire test-data setup when the API schema changes. The Playwright approach: intercept the network request and return exactly the response you need — immediately, deterministically, and independently of the backend's state. page.route('**/api/users', route => route.fulfill({ status: 200, body: JSON.stringify(mockUsers) })). The test now controls the API response — not the other way around. At Accenture, Mitchell worked on a project where the staging API changed schema every two sprints — breaking 40% of the E2E tests each time. The team's solution: network interception at the browser level, not backend mocking. Every API call the application made was intercepted by Playwright and fulfilled with a known response. The tests no longer depended on the staging API being available, correctly seeded, or schema-stable. Test reliability went from 60% to 99%. The interviewer wants to hear that you understand route.fulfill() and route.abort() not as convenience methods but as architectural primitives that decouple your UI tests from backend instability — and that you can discuss when to use network interception (isolating the frontend, testing error states, simulating latency) vs when to use real API calls (true end-to-end validation, contract verification).
Signal 4: You Think in Locator Semantics — Not CSS Selectors
Selenium trained a generation of SDETs to think in CSS selectors: .btn-primary > span.label. Playwright asks you to think in locator semantics: getByRole('button', { name: 'Submit' }). The difference is not syntax. It is a fundamental shift in what a locator represents. A CSS selector identifies a DOM position — it breaks when the DOM structure changes, even if the user-visible behaviour is identical. A semantic locator identifies a user-facing element — it survives DOM restructuring because it targets what the user sees and interacts with, not where the element sits in the DOM tree. At the Co-op, Mitchell's team migrated a Selenium suite to Playwright — and replaced 2,800 CSS-selector locators with semantic locators. Over the following six months, the application underwent three major UI redesigns — the DOM structure changed dramatically each time. The old Selenium locators would have broken on ~60% of tests. The Playwright semantic locators broke on less than 5%. The interviewer is testing whether you understand locator resilience as a test-maintenance strategy — and whether you reach for getByRole before locator('.css-selector').
The 7 Most Common Playwright Interview Questions — With Model Answers
These are the questions that appear most frequently in SDET interviews when Playwright is on the job specification. Each answer is structured to demonstrate framework architecture understanding — not tool familiarity.
Q1: How does Playwright's auto-waiting mechanism work — and how does it differ from Selenium's implicit and explicit waits?
What the interviewer is testing: Whether you understand auto-waiting as an architectural feature, not a convenience — and whether you can explain how it changes test design.
Model answer: Playwright's auto-waiting is not an optional configuration — it is a fundamental property of every action and assertion in the framework. Before performing any action — click(), fill(), selectOption(), press() — Playwright runs a series of actionability checks on the target element: (1) Attached — the element is connected to the DOM. (2) Visible — the element has non-zero size and is not display: none or visibility: hidden. (3) Stable — the element has not moved for at least two consecutive animation frames, preventing clicks on elements that are mid-transition. (4) Receives events — the element is not obscured by another element at the click point. (5) Enabled — the element is not disabled. These checks run repeatedly within a configurable timeout (default 30 seconds), and the action proceeds only when all checks pass.
This is fundamentally different from Selenium's wait model. In Selenium, an implicit wait tells the WebDriver to poll the DOM for a specified duration when locating an element — but once the element is found, the wait stops, regardless of whether the element is actually ready for interaction. An explicit wait (WebDriverWait with ExpectedConditions) requires you to write wait logic for every async interaction — specifying the condition, the timeout, and the polling interval. The result: Selenium tests are littered with wait statements — and missing a single wait causes flakiness that is hard to diagnose because the failure depends on timing.
Playwright's web-first assertions extend auto-waiting to the assertion layer. expect(locator).toBeVisible(), expect(locator).toHaveText('Submitted'), expect(locator).toContainText('Success') — these assertions retry automatically until the condition is met or the timeout expires. No waitForSelector, no waitForFunction, no polling configuration. The assertion is the wait. This eliminates the category of flakiness where an assertion runs before the UI has updated — because in Playwright, the assertion waits for the UI to reach the expected state before evaluating.
The design impact: in Selenium, you write tests defensively — adding waits before every interaction because you cannot be sure the previous action has completed. In Playwright, you write tests declaratively — stating what you expect the page to look like, and trusting the framework to wait until it does. This changes test readability, maintenance, and reliability simultaneously. A Selenium test with 12 explicit waits is hard to read and easy to break. A Playwright test with 12 web-first assertions is self-documenting — each assertion describes the expected state transition.
Q2: Explain Playwright locators — and when would you use getByRole vs getByTestId vs getByText?
What the interviewer is testing: Whether you have a locator strategy — not just a list of locator methods — and whether you prioritise accessibility-resilient locators over implementation-detail locators.
Model answer: Playwright's locator API is ordered by resilience — the framework recommends a specific priority, and understanding why reveals whether you think about test maintenance strategically. The recommended priority: getByRole → getByLabel → getByPlaceholder → getByText → getByAltText → getByTitle → getByTestId.
getByRole is the most resilient locator because it mirrors how assistive technologies identify elements — by their ARIA role and accessible name. page.getByRole('button', { name: 'Submit' }) targets the button that a screen reader would announce as 'Submit button.' It survives DOM restructuring because it does not depend on CSS classes, DOM hierarchy, or element IDs — it depends on the semantic role, which is stable even when the implementation changes. If a developer changes <button class="btn-primary">Submit</button> to <div><button class="btn-lg btn-brand">Submit</button></div> — the getByRole locator still works. A CSS-selector locator would break on both the class change and the DOM restructuring.
getByLabel targets form inputs by their associated label — page.getByLabel('Email address') matches the input whose <label> element (connected via for attribute or nesting) reads 'Email address.' It is resilient because labels are driven by user-facing content, not implementation details. getByPlaceholder is similar — it targets inputs by their placeholder text, which is visible to users and tends to be stable.
getByText targets elements by their visible text content — page.getByText('Your order has been placed'). It is useful for assertions on content that appears dynamically but should be used sparingly for interactions because text content changes more frequently than roles or labels — especially in internationalised applications.
getByTestId is the escape hatch — page.getByTestId('checkout-button') targets elements by their data-testid attribute. It is resilient to DOM restructuring but requires developer cooperation to add data-testid attributes. It is the right choice when: (a) the UI is highly dynamic and no semantic locator is stable, or (b) you need to target a specific instance of a repeated component. But overusing getByTestId creates a maintenance burden — every data-testid is a contract between the test and the implementation that must be maintained.
The key interview signal: a candidate who leads with locator('.css-selector') and uses getByRole as a fallback is signalling Selenium habits. A candidate who leads with getByRole and uses getByTestId only when semantic locators are insufficient is signalling Playwright-native thinking.
Q3: What are browser contexts in Playwright — and how do they enable test isolation better than Selenium?
What the interviewer is testing: Whether you understand the browser context as an architectural concept — and whether you can explain how it solves real testing problems that Selenium cannot.
Model answer: A browser context in Playwright is an isolated browsing session — analogous to an incognito window in Chrome. Each context has its own: cookies and localStorage (completely isolated — setting a cookie in context A does not affect context B), sessionStorage, cache (including service worker caches), network state (including authentication tokens), and browser permissions (geolocation, notifications, camera, microphone). Multiple contexts can coexist within a single browser instance, and they are cheap — creating a new context takes approximately 10 milliseconds and consumes minimal memory.
This architecture enables test isolation patterns that are impossible in Selenium without launching separate browser instances. (1) Authentication isolation: authenticate once per context — not once per test — and reuse the authenticated context across tests that share the same user. In Selenium, you either authenticate before every test (slow) or share browser state across tests (risk of test cross-contamination). (2) Parallel test isolation: every test gets its own context — its own cookies, localStorage, and network state — with zero risk of one test's state leaking into another. You can run 15 tests in parallel on one machine, each with isolated state. Selenium requires separate browser instances for isolation, limiting parallelism to available machine resources. (3) Device and permission emulation: a browser context can be configured with a specific viewport, geolocation, locale, timezone, colour scheme (dark/light mode), and permission grants — all at context creation, without affecting other contexts. This means one test can run as an iPhone 15 user in Tokyo with dark mode enabled, while the next test runs as a Desktop user in London with light mode — on the same machine, in the same test run, without breaking isolation.
At BT, Mitchell's team tested a multi-tenant application where each tenant had different authentication, feature flags, and UI configurations. With Selenium, testing three tenants required three browser instances — slow, resource-heavy, and prone to session-cookie leakage. With Playwright, three browser contexts handled it in one browser instance — each context had its own authentication token, its own localStorage configuration, and its own feature-flag state. Test execution time dropped by 65%. Context isolation transformed the testing of a multi-tenant system from an infrastructure problem into a configuration problem.
Q4: How do you use Playwright for API testing — and how is it different from tools like Supertest or Postman?
What the interviewer is testing: Whether you understand Playwright's dual capability — UI automation and API testing in the same framework — and the testing patterns this unlocks.
Model answer: Playwright provides API testing through the APIRequestContext — a separate HTTP client built into the framework that is independent of browser automation. You create it with request.newContext() and it provides methods for GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS requests — with full support for headers, query parameters, request bodies, form data, file uploads, and authentication.
What makes Playwright's API testing unique is not the individual API calls — Supertest, RestAssured, and Postman can all make HTTP requests. The unique capability is combining API testing with UI testing in the same test file, sharing authentication state between them. Pattern: authenticate via API (fast, reliable, no UI dependency), store the authentication token, inject it into a browser context — and now your UI test starts already authenticated. Or the reverse: perform a UI action (fill a form, submit), then verify the result via API (check the database or backend state through an API call).
Example: test a checkout flow. (1) Use APIRequestContext to create a user, add items to a cart, and apply a promo code — all via API, in under 200ms, without touching the browser. (2) Inject the session cookie into a browserContext — the browser now has the cart pre-loaded. (3) Use UI automation for the final checkout steps — the payment form, the address entry, the confirmation page — the parts that actually need a browser. (4) Verify the order via API — check the order status, the line items, the payment amount. This hybrid approach gives you the speed and reliability of API testing for data setup and verification, combined with UI testing for the user-facing interactions. No UI-only test framework can do this. No API-only test tool can do this. Playwright is the only mainstream test framework that treats API and UI testing as equal capabilities — and interviewers want to hear that you understand the testing patterns this enables.
Q5: How does Playwright's network interception work — and when would you use route.fulfill vs route.abort?
What the interviewer is testing: Whether you understand network interception as a testing strategy — not a feature — and whether you can distinguish between mocking scenarios.
Model answer: Playwright's network interception API intercepts HTTP requests at the browser level — before they leave the browser — and allows you to modify, fulfil, abort, or continue them. This is routed through the Chrome DevTools Protocol (or the equivalent Firefox/WebKit protocols), giving Playwright access to every network request the page makes — including fetch, XHR, WebSocket connections, image loads, and service worker requests.
route.fulfill() responds to a matched request without sending it to the server. Use it when: (a) the backend is unavailable, unstable, or rate-limited — your UI tests should not depend on backend availability; (b) you need a specific API response to test a UI state — an empty list, a full list, a specific error message, a slow-loading spinner; (c) you are testing error states — a 500 response, a network timeout, a malformed JSON body — that are hard or impossible to trigger through the real backend; (d) you want deterministic, repeatable UI tests that produce the same result every time, regardless of backend state. Example: await page.route('**/api/users', route => route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify([{ id: 1, name: 'Alice' }]) })) — every call to any URL ending in /api/users returns the mock response.
route.abort() simulates a network failure — the request is terminated with no response. Use it when: (a) testing offline behaviour — what does the application display when the API is unreachable; (b) testing graceful degradation — does the UI show a meaningful error message instead of a blank page; (c) testing retry logic — does the application retry the request with the correct backoff strategy. Example: await page.route('**/api/products', route => route.abort('internetdisconnected')) — simulates a network failure for the products API. The application should display 'Unable to load products. Check your connection and try again.' — and the test should assert that message appears.
route.continue() allows the request to proceed to the real server — optionally modified. Use it when: (a) you need to modify request headers — adding authentication tokens, changing User-Agent strings; (b) you need to modify the response — stripping sensitive data, injecting test attributes; (c) you need to log or measure requests while still hitting the real backend.
The strategic distinction: route.fulfill() decouples the test from the backend entirely — the test controls the response. route.abort() verifies that the application handles failure gracefully. route.continue() passes through to the real backend while giving you observation and modification points. The interviewer wants to hear that you can choose the right interception strategy based on what you are testing — frontend behaviour, error handling, or true end-to-end integration.
Q6: How does visual comparison testing work in Playwright with toHaveScreenshot — and what makes it different from pixel-diff tools?
What the interviewer is testing: Whether you understand visual testing as a quality gate — including the failure modes, configuration, and maintenance strategy.
Model answer: Playwright's toHaveScreenshot() assertion captures a screenshot of an element or page and compares it to a stored reference screenshot (a 'golden image'). If the pixel difference exceeds a configurable threshold, the test fails. The comparison is performed by a pixelmatch-based diffing algorithm that identifies exactly which pixels changed — and Playwright generates a diff image highlighting the changed regions, stored alongside the test results.
What makes Playwright's visual testing production-grade — and different from simple pixel-diff tools — is: (1) Built-in anti-flakiness: Playwright waits for the page to reach a stable state before capturing the screenshot — no animations in progress, no pending network requests, no incomplete font loads. Pixel-diff tools that capture screenshots without these guarantees produce flaky results because they capture frames mid-transition. (2) Configurable thresholds: maxDiffPixelRatio (default 0 — any difference fails) and threshold (colour difference per pixel, 0-1) let you control sensitivity. A threshold of 0.02 means a 2% colour difference is permitted — tolerating anti-aliasing differences across operating systems and rendering engines without ignoring genuine visual regressions. (3) Masking: mask: [page.locator('.timestamp')] excludes dynamic elements (timestamps, random IDs, ads, personalised content) from the comparison — so a changing timestamp does not fail your visual test. (4) Snapshot naming and storage: Screenshots are stored in a deterministic file structure — test-name-project-browser-platform.png — enabling cross-platform comparison and CI-stored baselines. (5) Update mode: --update-snapshots flag regenerates all golden images in one command — useful after an intentional UI redesign.
At Asda, Mitchell's team added toHaveScreenshot() assertions to their checkout flow — capturing the cart, the delivery slot selector, the payment form, and the confirmation page. Within the first sprint, visual testing caught a regression where a CSS change to the button component had shifted the 'Place Order' button 4 pixels to the right — invisible to functional tests (the button still worked, the text was correct), but a visual regression that would have reached production. The pixel-diff highlighted the shift immediately — and the developer fixed it in 5 minutes instead of discovering it through a customer complaint two weeks later. Visual testing catches the category of bugs that functional testing cannot — because the functionality works, but the presentation is broken.
Q7: How do Playwright fixtures and test hooks work — and how are they different from beforeEach/afterEach in Jest?
What the interviewer is testing: Whether you understand Playwright's test runner architecture — including fixture dependency injection, worker-scoped fixtures, and the test isolation model.
Model answer: Playwright's test runner is built on a fixture system that is fundamentally different from Jest's setup/teardown hooks. The key concept is dependency injection: a test declares what it needs, and the runner provides it — managing the lifecycle automatically.
In Jest, you write:
let browser: Browser;
beforeEach(async () => {
browser = await chromium.launch();
});
afterEach(async () => {
await browser.close();
});
test('login flow', async () => {
const page = await browser.newPage();
// test logic
});
The problems: (1) You manually manage the lifecycle — if you forget afterEach, browsers stay open. (2) Every test gets the same setup — you cannot configure a test to use a different browser or authenticated session without conditional logic in beforeEach. (3) The test is responsible for creating its own page object — duplicate boilerplate in every test.
In Playwright, the equivalent:
import { test, expect } from '@playwright/test';
test('login flow', async ({ page }) => {
// page is auto-created, auto-navigated, auto-closed
await page.goto('/login');
// test logic
});
The { page } parameter is a fixture — Playwright's test runner creates a new page in a new browser context, injects it into the test, and tears it down when the test completes. The test never sees the browser, context, or page lifecycle. This is the built-in page fixture — one of several built-in fixtures (browser, browserName, context, page, request).
Custom fixtures extend this pattern. Example — an authenticated page fixture:
const test = base.extend<{ authenticatedPage: Page }>({
authenticatedPage: async ({ browser }, use) => {
const context = await browser.newContext();
const page = await context.newPage();
await page.goto('/login');
await page.fill('[name="email"]', 'test@example.com');
await page.fill('[name="password"]', 'password');
await page.click('button[type="submit"]');
await expect(page).toHaveURL('/dashboard');
await use(page);
await context.close();
},
});
test('view profile', async ({ authenticatedPage }) => {
await authenticatedPage.click('text=Profile');
await expect(authenticatedPage).toHaveURL('/profile');
});
Key differences from Jest hooks: (1) Fixture scope: Playwright fixtures can be test-scoped (created per test) or worker-scoped (created once per worker and shared across tests in that worker — e.g., a database connection). Jest's beforeAll/afterAll is the closest equivalent but lacks the dependency-injection pattern. (2) Fixture composition: fixtures can depend on other fixtures — authenticatedPage depends on browser, which Playwright resolves automatically. In Jest, you would need to chain beforeAll hooks or manage dependencies manually. (3) Test declaration: the test declares its dependencies through parameters. A test that needs an authenticated page includes { authenticatedPage }; a test that does not need authentication omits it — and the authentication fixture is never created. This is compile-time dependency selection, not runtime conditional logic. (4) Automatic teardown: the use() pattern provides setup/teardown around a test — code before use(page) is setup, code after is teardown, executed regardless of test failure. In Jest, teardown in afterEach must handle the case where setup partially completed — a common source of flaky test infrastructure.
The interviewer wants to hear that you understand fixtures as a dependency-injection pattern — not a setup/teardown mechanism. The candidate who says 'fixtures are like beforeEach' has used Playwright's test runner. The candidate who says 'fixtures are a dependency-injection system with automatic lifecycle management and scope control' understands its architecture.
How Playwright Fits Into the 2026 SDET Landscape
Playwright is not just another testing tool. It is the framework that reflects how organisations think about quality engineering in 2026 — and understanding its strategic position is as important as understanding its API:
Playwright Has Replaced Selenium as the Default Browser-Automation Framework — and the Migration Is Accelerating
In 2024, Playwright surpassed Selenium in npm downloads for the first time. In 2025, the State of JS survey showed Playwright as the most-adopted testing framework among professional developers. In 2026, job specifications that list 'Selenium' without 'Playwright' are the minority — and the specification that lists 'Playwright' without 'Selenium' is increasing every quarter. The reasons go beyond feature comparison: Playwright is backed by Microsoft and maintained by the same engineers who built Puppeteer and contributed to the Chrome DevTools Protocol. It has browser-vendor-level access to rendering engines. It ships with TypeScript types generated from the source. It has a built-in test runner that handles parallelism, retries, tracing, and reporting — capabilities that required separate tools (TestNG, Allure, Selenium Grid) in the Selenium ecosystem. The migration from Selenium to Playwright is not a tool swap — it is an architectural upgrade that changes how organisations think about test reliability, execution speed, and framework maintenance. The SDET who can lead a Selenium-to-Playwright migration — not just rewrite tests, but redesign the testing strategy around browser contexts, auto-waiting, and network interception — is the SDET who commands the senior roles.
Playwright Unifies UI and API Testing — Breaking Down the Traditional Testing Silos
For a decade, the testing industry separated UI testing (Selenium, Cypress) from API testing (Supertest, RestAssured, Postman) into different tools, different frameworks, different teams. Playwright eliminates that separation — API testing and UI testing share the same framework, the same configuration, the same test runner, and the same CI pipeline. This unification matters for three reasons: (1) Reduced context-switching — an SDET writing a checkout test does not need to open Postman for API calls and VS Code for UI tests. They write both in the same test() function. (2) Shared authentication — authenticate via API and inject the token into the browser context, eliminating the slowest and flakiest part of UI testing (logging in through the UI). (3) Coordinated assertions — verify a UI action by checking the API response, and verify an API action by checking the UI state. This is not just convenience — it enables testing patterns that were architecturally impossible when UI and API testing were separate concerns. The SDET who can design tests that span UI and API boundaries — using the right testing mode for each step — is demonstrating the architectural thinking that separates framework users from framework architects.
Playwright's Debugging Tooling — Trace Viewer, Codegen, and the Inspector — Changes How Teams Investigate Test Failures
The darkest hour of test automation is the 3am CI failure with a screenshot that shows a blank page and a log that says 'element not found.' In Selenium, debugging that failure means: adding logging statements, re-running locally (different environment, different timing, probably passes), adding Thread.sleep() calls, and eventually giving up and marking the test as @Flaky. Playwright's debugging tooling changes this: (1) Trace Viewer: every test run generates a trace — a timeline of every action, every network request, every console message, every DOM snapshot. Open it in playwright show-trace or trace.playwright.dev and you can step through the test frame by frame — seeing exactly what the page looked like before the failing action, what network requests were in flight, what console errors fired, and what the DOM state was. The trace viewer turns a 45-minute debugging session into a 2-minute root-cause identification. (2) Codegen: npx playwright codegen https://example.com opens the application and records your interactions — clicks, fills, navigations — generating Playwright test code in real time. It is not a replacement for writing tests (generated locators need refinement), but it is a rapid-prototyping tool that turns 'how do I test this flow' into a working test skeleton in 60 seconds. (3) Inspector: the Playwright Inspector is a GUI debugging tool that lets you step through Playwright tests line by line — click 'Step Over' to execute the next action, inspect the page state, and see which locators match. The combination of Trace Viewer for post-hoc debugging, Codegen for test prototyping, and Inspector for interactive debugging gives Playwright a debugging toolchain that no other browser-automation framework matches. The SDET who can use these tools to reduce test-failure investigation time from hours to minutes is delivering measurable value to their team — and interviewers want to hear that you can describe a specific debugging workflow using these tools.
Common Mistakes SDETs Make When Answering Playwright Interview Questions
These are the answers that Mitchell has heard candidates give — and immediately lost the interviewer's confidence. Know them so you do not make them:
Mistake 1: 'Playwright is just like Selenium but faster.'
This is the fastest way to signal that you have used Playwright at the surface level — running tests someone else wrote — not architected a Playwright framework. Playwright is architecturally different from Selenium in four fundamental ways: (1) Communication protocol — Playwright uses the Chrome DevTools Protocol (and equivalent Firefox/WebKit protocols) directly; Selenium uses the WebDriver JSON wire protocol with a separate driver binary. (2) Auto-waiting — Playwright actions and assertions retry automatically; Selenium requires explicit waits for every async interaction. (3) Browser contexts — Playwright creates isolated browsing sessions (~10ms each) that share a browser process; Selenium requires separate browser instances for isolation (~500ms each). (4) Built-in test runner — Playwright includes fixture-based test orchestration, parallel execution, retries, tracing, and reporting; Selenium requires TestNG/JUnit for test running, Selenium Grid for parallelism, and Allure/ExtentReports for reporting. A candidate who describes Playwright as 'Selenium but faster' does not understand the architectural differences — and will not be trusted to lead a migration or design a Playwright testing strategy. The fix: explain the architectural differences and what they enable. 'Playwright uses the DevTools Protocol directly — bypassing the WebDriver network hop — which eliminates the communication latency and serialisation overhead that causes many Selenium flakiness categories. Combined with auto-waiting actionability checks, this produces tests that are not just faster but structurally more reliable.'
Mistake 2: 'I use CSS selectors for all my Playwright locators — they are more precise.'
CSS selectors are precise in the moment they are written and fragile the moment the DOM changes. The Playwright team recommends a locator priority that goes from most resilient to least: getByRole → getByLabel → getByPlaceholder → getByText → getByAltText → getByTitle → getByTestId. CSS selectors (and XPath) are not even on the list — they are the last resort. Every CSS selector embeds an assumption about DOM structure: .checkout-panel > div:nth-child(3) > button.btn-primary assumes a three-level nesting with specific class names and child positions. When a developer refactors the checkout panel into a React component with different CSS modules, the locator breaks — even though the button still says 'Place Order' and the user experience is identical. A getByRole('button', { name: 'Place Order' }) locator survives the refactoring because the role (button) and the accessible name (Place Order) are unchanged. The fix: describe your locator strategy as a priority system. 'I default to semantic locators — getByRole, getByLabel, getByPlaceholder — because they survive DOM restructuring. I use getByTestId when semantic locators are insufficient — for dynamic lists, repeated components, or elements without accessible names. I avoid CSS selectors except when testing implementation details directly — and I add a comment explaining why a semantic locator was not possible.'
Mistake 3: 'I do not use network interception because we test against the real backend.'
This signals that you treat test reliability as the backend's responsibility — and you have not experienced the failure modes that network interception eliminates. Real-backend testing has three failure modes that network interception solves: (1) Backend unavailability — staging environments go down, rate limits get hit, databases get reseeded mid-test-run. A UI test that depends on the backend being available is a UI test that fails for reasons unrelated to the UI. (2) Non-deterministic data — the same API endpoint returns different data at different times (a list that grows, a status that changes, a timestamp that updates). A UI test that asserts 'there are 5 items in the list' fails when the 6th item is added by another test or a background job. (3) Untestable error states — testing 'what happens when the payment API returns a 500?' is impossible with a real backend (you cannot break production), difficult with staging (you need to coordinate with the backend team), and instant with network interception (route.fulfill({ status: 500 })). The fix: describe a hybrid strategy. 'I use network interception for UI-focused tests — verifying that the frontend renders correctly, handles loading states, displays errors, and responds to user interactions. I use real-backend calls for true end-to-end tests — a smaller suite that validates the full stack integration, run less frequently but covering the critical paths that cannot be fully tested in isolation.'
Mistake 4: 'Playwright vs Cypress — I just use whatever the team uses.'
This signals either ignorance of the differences or unwillingness to form a technical opinion — both of which lose senior-level offers. Playwright and Cypress differ architecturally in ways that matter for framework selection: (1) Multi-tab and multi-origin — Playwright supports them natively (browser contexts, page.context().newPage()); Cypress does not (single-tab, same-origin limitation). If your application opens OAuth flows in new windows, redirects to third-party payment providers, or uses multiple subdomains — Playwright works. Cypress requires workarounds. (2) Network interception — Playwright intercepts at the browser network level (all request types, including fetch, WebSocket, and service workers); Cypress intercepts at the application's network layer (XHR and fetch only, relies on cy.intercept()). (3) Execution model — Playwright runs outside the browser (Node.js process communicating via DevTools protocol); Cypress runs inside the browser (same JavaScript event loop as the application). This makes Cypress easier to debug (you can inspect the app state directly) but limits what it can do (no multi-tab, no native events, no file downloads in some cases). (4) Language support — Playwright supports TypeScript/JavaScript, Python, Java, and .NET; Cypress supports TypeScript/JavaScript only. The fix: acknowledge the trade-offs. 'I choose Playwright for applications that require multi-tab, multi-origin, or mobile emulation — and for teams that need Python or Java bindings. I acknowledge that Cypress has a lower barrier to entry and excellent developer experience for single-page applications — and I would use it when the application fits Cypress's architectural constraints and the team values the debugging experience.'
How to Prepare for Playwright Interview Questions — Starting Tonight
You do not need to have migrated a 500-test Selenium suite to Playwright to answer Playwright interview questions well. You need to understand the framework architecture, be able to articulate why Playwright's design choices matter, and demonstrate that you think about test automation at the framework-design level — not the script-writing level. Here is the 3-step plan:
- Download SDET Interview Coach and complete the 2-minute onboarding assessment. Select 'Playwright' as your topic area and your target seniority level. The app surfaces Playwright questions calibrated to your interview — Junior candidates get locator-strategy and basic-auto-waiting questions, while Senior and Lead candidates face framework-architecture, migration-strategy, and test-infrastructure-design discussions. The app's 800+ questions across 32 topics ensure you are prepared for every dimension of the SDET interview — including the Playwright questions that separate Selenium users from Playwright architects. At £4.99 per month on iOS, it is the most efficient way to convert reading about Playwright into discussing Playwright under interview pressure.
- Run a Playwright mock interview today. Pick the Playwright topic area. Answer the questions out loud — articulating why auto-waiting eliminates flakiness categories, how browser contexts enable parallelisation, when to use network interception vs real-backend calls, and how you would design a Playwright testing strategy for a multi-tenant SaaS application. The AI feedback scores you on technical accuracy, completeness, communication, and code quality — showing you exactly where your Playwright knowledge gaps are before the real interview panel exposes them. The difference between knowing that Playwright has auto-waiting and explaining how actionability checks work under interview pressure is the difference between a correct answer and a confident answer. The mock interview bridges that gap.
- Use Job Match for your target role. Paste the job description into Job Match. If the JD mentions 'Playwright,' 'browser automation,' 'end-to-end testing,' 'TypeScript testing,' 'visual regression,' 'network interception,' or 'cross-browser testing,' you will get 50 questions tailored to that exact role's Playwright expectations — including architecture-design questions at the right seniority level. The Job Match feature ensures you are not just prepared for Playwright interviews in general — you are prepared for the specific Playwright questions that your target company asks.
The Playwright question is not testing whether you can write await page.click('.submit-button') and check that the URL changed. It is testing whether you understand the framework as an architectural decision — with auto-waiting that eliminates the most common flakiness categories, browser contexts that enable isolation and parallelism at zero cost, network interception that decouples UI tests from backend instability, semantic locators that survive DOM restructuring, and a test runner that treats fixtures as dependency injection — not setup/teardown hooks. The candidates who walk into interviews in 2026 with a clear Playwright architecture philosophy — locator strategy, isolation model, mocking strategy, and debugging workflow — are the ones who get offers over candidates who say 'I have used Playwright on one project.' Playwright is an architectural upgrade, not a tool swap. Understand the architecture. Walk in ready.
For more on the testing frameworks that complement Playwright, see our guide on Selenium WebDriver Interview Questions 2026. For how Playwright integrates with CI/CD pipelines, see our guide on CI/CD SDET Interview Questions 2026. For mocking APIs during Playwright tests, see our guide on Mock Service Worker (MSW) Testing Interview Questions 2026. For debugging strategies that complement Playwright's Trace Viewer, see our guide on Browser DevTools Test Debugging SDET Interview Questions 2026. For API testing strategies that work alongside Playwright's request context, see our guide on API Testing Interview Questions 2026. If you are preparing for a full SDET interview loop, our SDET interview preparation plan covers the complete roadmap — including Playwright, API testing, and CI/CD test strategy.
Ready to Transform Your Testing?
The AI Test Automation Playbook gives you everything you need: Playwright setup, Claude AI integration, MCP deep dive, 10+ ready-to-use prompts, CI/CD pipeline setup, and a 30-day implementation roadmap.
By Mitchell Agoma, Senior SDET & AI Testing Specialist with 8+ years of experience