The pillar guide. 27 real head-to-head Playwright vs Selenium interview questions with a WebSocket vs JSON Wire Protocol architecture diagram, senior-SDET answers, comparison tables, and side-by-side code — architecture, auto-wait, locators, parallelism, network interception, tracing, migration strategy, and framework-choice scenarios.
Comparison questions like this test whether you understand Playwright vs Selenium — what's the 30-second answer at a design level — not just that both exist, but when to pick one over the other. Panels use it to see if you can defend a trade-off with a real project example.
Detailed explanation
Playwright is the modern, faster, TypeScript-first framework with native auto-wait, parallel-by-default execution, and trace viewer. Selenium is the mature, cross-language W3C-standard tool with the biggest install base and enterprise footprint. In 2026: pick Playwright for greenfield, Selenium for existing Java/Grid shops.
Tips to remember
Structure the answer as a small table in your head: dimension, option A, option B — and close with "I'd pick X when Y".
Keep the answer to 60–90 seconds; anything longer signals you can't summarise Playwright vs Selenium — what's the 30-second answer cleanly.
State that you never mix wait strategies and never use a hard sleep, then give the timeout value you actually run in CI.
Listing questions on Which is faster look easy but trap candidates who rattle off names without depth. Interviewers score higher when you group the items, mention which you use most, and add one line of context per item.
Detailed explanation
Playwright — often 2–5x on the same suite. Reasons: single WebSocket connection per browser (vs HTTP-per-command for WebDriver), workers run tests in parallel by default, and auto-wait eliminates dead sleeps.
Tips to remember
Group the items into 2–3 categories before listing — panels remember structure, not raw counts.
Be ready to whiteboard the Which is faster snippet live — panels often ask you to type it, not describe it.
State that you never mix wait strategies and never use a hard sleep, then give the timeout value you actually run in CI.
Listing questions on Which supports more languages look easy but trap candidates who rattle off names without depth. Interviewers score higher when you group the items, mention which you use most, and add one line of context per item.
Listing questions on Which supports more browsers look easy but trap candidates who rattle off names without depth. Interviewers score higher when you group the items, mention which you use most, and add one line of context per item.
Detailed explanation
Browser
Selenium
Playwright
Chrome / Edge
Yes
Yes (bundled Chromium)
Firefox
Yes
Yes (bundled)
Safari
Yes (SafariDriver)
WebKit engine (not Safari itself)
IE 11
Yes (legacy)
No
Mobile emulation
Basic
Rich device profiles
Tips to remember
Group the items into 2–3 categories before listing — panels remember structure, not raw counts.
Rebuild the Which supports more browsers comparison table from memory before the interview — panels probe the least-used row.
Split the answer into emulator (fast feedback) vs real device (final gate) and say where each runs in your pipeline.
Listing questions on Which one auto-waits look easy but trap candidates who rattle off names without depth. Interviewers score higher when you group the items, mention which you use most, and add one line of context per item.
Detailed explanation
Playwright — every action waits for visible + stable + enabled + receiving-events before firing. Selenium requires explicit waits (WebDriverWait + ExpectedConditions).
Tips to remember
Group the items into 2–3 categories before listing — panels remember structure, not raw counts.
Be ready to whiteboard the Which one auto-waits snippet live — panels often ask you to type it, not describe it.
State that you never mix wait strategies and never use a hard sleep, then give the timeout value you actually run in CI.
Listing questions on Which handles multi-tab / multi-window better look easy but trap candidates who rattle off names without depth. Interviewers score higher when you group the items, mention which you use most, and add one line of context per item.
Detailed explanation
Playwright — first-class BrowserContext and page.context().pages(). Selenium supports it via getWindowHandles(), but the API is more verbose and less isolated.
Tips to remember
Group the items into 2–3 categories before listing — panels remember structure, not raw counts.
Be ready to whiteboard the Which handles multi-tab / multi-window better snippet live — panels often ask you to type it, not describe it.
If you can confidently answer the Core Differences questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.
2. Architecture & Setup (Pillar)
Hard Very Common 2 minQ7 / 27
Q7.Explain the architecture difference (with diagram).
Open-ended "explain architecture difference (with diagram)" prompts test how you structure a technical answer under pressure. Panels look for a clear opening definition, one worked example, and a closing sentence on the pitfall they were about to ask about next.
Detailed explanation
The single biggest architectural gap between the two frameworks is how the test process talks to the browser. Selenium sends one HTTP request per command over the JSON Wire / W3C WebDriver protocol. Playwright opens a single, persistent WebSocket connection using a CDP-derived protocol and streams every command and event through it.
Fig. 1 — Selenium JSON Wire vs Playwright WebSocket architecture. Same 800-command suite, 10–20× lower protocol overhead.
Aspect
Selenium (JSON Wire / W3C)
Playwright (WebSocket / CDP)
Transport
HTTP/1.1 (JSON body)
WebSocket (binary frames, JSON-RPC)
Connection lifetime
Per-command request/response
One persistent duplex socket per browser
Directionality
Client → Driver only (polling)
Full duplex — browser pushes events
Session state
Stateless; session id on every URL
Stateful; connection is the session
Per-command latency
~20–40 ms (handshake + parse)
~1–3 ms (single frame)
Auto-wait / events
Client polls with WebDriverWait
Server streams frame.navigated, request, dialog
Extra binary needed
chromedriver / geckodriver
None — driver is bundled npm package
Real-world takeaway: on a 500-test regression, the transport alone accounts for a meaningful chunk of runtime. WebSocket also unlocks features Selenium can only bolt on later (network interception, tracing, dialog handlers) because the browser can push events without the client asking.
Tips to remember
Use a 3-part frame for architecture difference (with diagram): what it is → how it works → one gotcha you've hit in a real Playwright vs Selenium project.
Be ready to whiteboard the architecture difference (with diagram) snippet live — panels often ask you to type it, not describe it.
Finish by saying you always return to the default content after frame work — forgetting that is the classic failure this question hunts for.
Comparison questions like this test whether you understand WebSocket vs JSON Wire Protocol — why does one connection beat many at a design level — not just that both exist, but when to pick one over the other. Panels use it to see if you can defend a trade-off with a real project example.
Detailed explanation
The JSON Wire Protocol (now the W3C WebDriver spec) was designed in 2011 to be a REST-like RPC on top of HTTP. Every action — findElement, click, getAttribute — is a separate HTTP call to http://localhost:PORT/session/<id>/<action>. WebSocket, born in RFC 6455, is a persistent full-duplex tunnel: after one handshake the client and server can push frames both ways.
Fig. 2 — Cost of connection. HTTP pays the handshake tax every command; WebSocket pays it once.
Why this matters in an interview answer:
Latency compounds. A UI test can fire 50–200 protocol calls per scenario. Multiply by suite size × CI runs per day and JSON Wire's per-call overhead becomes the pipeline's biggest hidden cost.
Event push kills polling. Playwright can subscribe to Network.responseReceived or Page.dialog and act the instant the browser fires them. Selenium has to loop with WebDriverWait, which is where most flakiness starts.
Backpressure & ordering. A single WS with monotonically increasing id preserves command order per browser context. HTTP concurrency has to be serialised in the driver, which is why Selenium WebElement references can go stale.
Firewalls. WS runs over the same 80/443 as HTTP and passes through most corporate proxies — the myth that WebSocket is blocked in the enterprise is largely gone in 2026.
If an interviewer probes deeper, mention that Selenium 4 can use BiDi (also WebSocket-based) for a subset of features — proof that the industry direction is one persistent socket, not many HTTP calls. Deep dive: Playwright vs Selenium (2026 comparison) and the pillar comparison blog.
Tips to remember
Structure the answer as a small table in your head: dimension, option A, option B — and close with "I'd pick X when Y".
Be ready to whiteboard the WebSocket vs JSON Wire Protocol — why does one connection beat many snippet live — panels often ask you to type it, not describe it.
Finish by saying you always return to the default content after frame work — forgetting that is the classic failure this question hunts for.
This Playwright vs Selenium question checks whether you can go beyond textbook knowledge on Installation — which is faster and reason about it the way a working QA engineer does — with a definition, an example, and the edge case that usually comes up next.
Detailed explanation
Playwright: npm i -D @playwright/test && npx playwright install — one command, bundles browsers. Selenium: add dependencies, drivers auto-download via Selenium Manager (4.6+), then wire in TestNG/JUnit.
Tips to remember
Anchor the answer in a real Playwright vs Selenium project — panels reward specificity on Installation — which is faster over textbook wording.
Be ready to whiteboard the Installation — which is faster snippet live — panels often ask you to type it, not describe it.
This Playwright vs Selenium question checks whether you can go beyond textbook knowledge on Does Playwright need a Selenium-style Grid and reason about it the way a working QA engineer does — with a definition, an example, and the edge case that usually comes up next.
Detailed explanation
No — Playwright is parallel-by-default via workers on a single machine. For horizontal scaling: shard with --shard=N/M across CI runners. Selenium needs Grid (or a cloud like BrowserStack) to fan out.
Tips to remember
Anchor the answer in a real Playwright vs Selenium project — panels reward specificity on Does Playwright need a Selenium-style Grid over textbook wording.
Be ready to whiteboard the Does Playwright need a Selenium-style Grid snippet live — panels often ask you to type it, not describe it.
Call out test isolation and shared-state risk (data, sessions, ports) before you talk about worker counts.
Hands-on "how would you write a login test in each" questions reveal whether you've actually shipped Playwright vs Selenium code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.
Hands-on "how would you handle SPA loading" questions reveal whether you've actually shipped Playwright vs Selenium code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.
Detailed explanation
Playwright: auto-waits for domcontentloaded/networkidle. Selenium: explicit wait on a stable element or URL change. Never rely on pageLoadTimeout alone for SPAs.
Tips to remember
Walk through handle SPA loading as numbered steps and call out the tool, command, or API used at each step.
Be ready to whiteboard the handle SPA loading snippet live — panels often ask you to type it, not describe it.
State that you never mix wait strategies and never use a hard sleep, then give the timeout value you actually run in CI.
If you can confidently answer the Architecture & Setup (Pillar) questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.
Comparison questions like this test whether you understand Compare the locator APIs at a design level — not just that both exist, but when to pick one over the other. Panels use it to see if you can defend a trade-off with a real project example.
Detailed explanation
Playwright's getByRole, getByLabel, getByTestId are accessibility-first and self-healing. Selenium's By.* is lower-level: id, css, xpath, plus Selenium 4 relative locators. Playwright's locators are lazy and re-evaluate; Selenium's WebElement can go stale.
Tips to remember
Structure the answer as a small table in your head: dimension, option A, option B — and close with "I'd pick X when Y".
Be ready to whiteboard the Compare the locator APIs snippet live — panels often ask you to type it, not describe it.
Say explicitly that you prefer CSS/relative locators and only fall back to XPath for text or axes — panels grade locator hygiene here.
Interviewers open with "Playwright's expect() vs Selenium assertions" to confirm you can define the concept in one crisp line before going deeper. In Playwright vs Selenium rounds this filters out candidates who only remember syntax and can't articulate the underlying idea to a non-expert teammate.
Detailed explanation
Playwright's expect(locator).toHaveText(...) auto-retries until the condition passes or times out. Selenium requires you to combine WebDriverWait + JUnit/TestNG assertion. Auto-retrying assertions are Playwright's single biggest flake-killer.
Tips to remember
Open with a one-sentence definition of Playwright's expect() vs Selenium assertions, then a concrete Playwright vs Selenium example — never start with history or theory.
Be ready to whiteboard the Playwright's expect() vs Selenium assertions snippet live — panels often ask you to type it, not describe it.
Hands-on "how would you handle iframes in each" questions reveal whether you've actually shipped Playwright vs Selenium code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.
Hands-on "how would you assert an element is hidden" questions reveal whether you've actually shipped Playwright vs Selenium code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.
Listing questions on Which is more resilient to flaky tests look easy but trap candidates who rattle off names without depth. Interviewers score higher when you group the items, mention which you use most, and add one line of context per item.
Detailed explanation
Playwright, materially — auto-wait, auto-retry assertions, isolated BrowserContext per test, and the Trace Viewer for post-mortem. Selenium flakes are usually solvable with disciplined explicit waits and POM, but the ceiling is lower.
Tips to remember
Group the items into 2–3 categories before listing — panels remember structure, not raw counts.
Be ready to whiteboard the Which is more resilient to flaky tests snippet live — panels often ask you to type it, not describe it.
State that you never mix wait strategies and never use a hard sleep, then give the timeout value you actually run in CI.
Hands-on "how would you run tests in parallel in each" questions reveal whether you've actually shipped Playwright vs Selenium code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.
If you can confidently answer the Waits, Locators & Assertions questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.
Hands-on "how would you intercept / mock network calls" questions reveal whether you've actually shipped Playwright vs Selenium code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.
Hands-on "how would you debug a failed test" questions reveal whether you've actually shipped Playwright vs Selenium code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.
Detailed explanation
Playwright: trace: 'on-first-retry' + open the Trace Viewer (DOM snapshots, network, console, actions timeline). Selenium: screenshots on failure via TestNG listener + Extent/Allure reports. Playwright's DX is meaningfully better here.
Tips to remember
Walk through debug a failed test as numbered steps and call out the tool, command, or API used at each step.
Be ready to whiteboard the debug a failed test snippet live — panels often ask you to type it, not describe it.
Say who reads the report and what decision it drives — evidence-for-humans framing beats a tool name list.
Listing questions on Which produces better reports look easy but trap candidates who rattle off names without depth. Interviewers score higher when you group the items, mention which you use most, and add one line of context per item.
Detailed explanation
Both need add-ons. Playwright: built-in HTML reporter + Trace Viewer. Selenium: Extent Reports, Allure, or ReportPortal via TestNG listener. Trace Viewer wins for step-by-step debugging.
Tips to remember
Group the items into 2–3 categories before listing — panels remember structure, not raw counts.
Keep the answer to 60–90 seconds; anything longer signals you can't summarise Which produces better reports cleanly.
Say who reads the report and what decision it drives — evidence-for-humans framing beats a tool name list.
Listing questions on Which one supports mobile app automation look easy but trap candidates who rattle off names without depth. Interviewers score higher when you group the items, mention which you use most, and add one line of context per item.
Detailed explanation
Neither — both are for web browsers. For native mobile you still need Appium (WebDriver-based). Playwright supports mobile emulation in Chromium/WebKit, but that's not real device testing.
Tips to remember
Group the items into 2–3 categories before listing — panels remember structure, not raw counts.
Keep the answer to 60–90 seconds; anything longer signals you can't summarise Which one supports mobile app automation cleanly.
Split the answer into emulator (fast feedback) vs real device (final gate) and say where each runs in your pipeline.
Hands-on "how would you handle CAPTCHA / OAuth pop-ups" questions reveal whether you've actually shipped Playwright vs Selenium code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.
Detailed explanation
Same strategy in both: bypass in test environments (test-mode CAPTCHA keys, direct-grant OAuth flows, seeded sessions). Neither tool magically solves CAPTCHAs.
Tips to remember
Walk through handle CAPTCHA / OAuth pop-ups as numbered steps and call out the tool, command, or API used at each step.
Keep the answer to 60–90 seconds; anything longer signals you can't summarise handle CAPTCHA / OAuth pop-ups cleanly.
Cover token expiry and refresh in your answer; most candidates only describe the happy-path login.
If you can confidently answer the Parallelism, Network & Tracing questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.
Timing questions like this check whether you understand the trade-offs of should I still choose Selenium in 2026. Interviewers want to hear the specific signals in a project that make you pick it over the alternative, plus one case where it's the wrong choice.
Detailed explanation
Existing Java/TestNG + Grid suite with hundreds of tests
Need Ruby / C# / Kotlin support
Enterprise / BFSI / gov shops with WebDriver-based tooling
Real Safari on macOS via SafariDriver
Tips to remember
Answer in the form "Use should I still choose Selenium in 2026 when …, avoid it when …" so the interviewer hears both sides in one breath.
Group the should I still choose Selenium in 2026 points into 2–3 buckets so you can recall them under pressure without missing one.
Mention capability matrix and cost/queue trade-offs — that's the operational angle panels probe next.
Timing questions like this check whether you understand the trade-offs of should I pick Playwright. Interviewers want to hear the specific signals in a project that make you pick it over the alternative, plus one case where it's the wrong choice.
Detailed explanation
Greenfield project with TypeScript/JavaScript/Python
Modern SPA (React/Vue/Angular) with heavy async
Team wants fast feedback loops and low flakiness
Cross-browser (Chromium + Firefox + WebKit) without infra
Hands-on "how would you migrate a Selenium suite to Playwright" questions reveal whether you've actually shipped Playwright vs Selenium code or only read about it. Interviewers listen for concrete steps, the tools you'd reach for first, and the failure mode you'd guard against.
Detailed explanation
Freeze new Selenium test additions
Port page objects one-by-one, keeping data models
Replace explicit waits with Playwright's auto-wait + expect
Add trace: 'on-first-retry' from day one
Run both suites in CI until parity, then delete Selenium
Tips to remember
Walk through migrate a Selenium suite to Playwright as numbered steps and call out the tool, command, or API used at each step.
Be ready to whiteboard the migrate a Selenium suite to Playwright snippet live — panels often ask you to type it, not describe it.
State that you never mix wait strategies and never use a hard sleep, then give the timeout value you actually run in CI.
Listing questions on Which one gets you hired faster in 2026 look easy but trap candidates who rattle off names without depth. Interviewers score higher when you group the items, mention which you use most, and add one line of context per item.
Detailed explanation
Depends on the market. India / US enterprise: Selenium still edges by JD count. US startups / EU product companies: Playwright is climbing fast and pays a premium. Ideal candidate knows both — see our Selenium 300 Q&A and Playwright Q&A.
Tips to remember
Group the items into 2–3 categories before listing — panels remember structure, not raw counts.
Keep the answer to 60–90 seconds; anything longer signals you can't summarise Which one gets you hired faster in 2026 cleanly.
If you can confidently answer the Choosing, Migrating & Career questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.
Quick revision
Q1: Playwright vs Selenium — what's the 30-second answer — Playwright is the modern, faster, TypeScript-first framework with native auto-wait, parallel-by-default execution, and trace viewer.
Q2: Which is faster — Playwright — often 2–5x on the same suite.
Q3: Which supports more languages — Selenium : Java, Python, C#, Ruby, JavaScript, Kotlin.
Q5: Which one auto-waits — Playwright — every action waits for visible + stable + enabled + receiving-events before firing.
Frequently asked questions
1.Is Playwright replacing Selenium?
Not yet. Playwright is the fastest-growing framework, but Selenium's install base and language breadth keep it dominant in enterprise. Expect coexistence through the late 2020s.
2.Can Playwright and Selenium share the same test infrastructure?
Somewhat. Both can post JUnit-XML to Jenkins/CircleCI, both work with cloud grids (BrowserStack, Sauce Labs), but the runners and locator APIs are incompatible — you can't literally reuse test code.
3.Which is easier for a fresher to learn?
Playwright — auto-wait removes the most confusing part of Selenium (waits), and the trace viewer makes debugging feel like a superpower.
4.Do FAANG companies ask Playwright vs Selenium questions?
Yes — SDET loops routinely ask you to justify a framework choice for a given system. Prep both sides.
Playwright vs Selenium jobs hiring now
Live, indexable Playwright vs Selenium openings — updated daily in Jobs Radar.