SoftwareTestPilot
26 Comparison Q&A

Playwright vs Selenium Interview Questions (1970)

26 real head-to-head Playwright vs Selenium interview questions with senior-SDET answers, comparison tables, and side-by-side code — architecture, auto-wait, locators, parallelism, network interception, tracing, migration strategy, and framework-choice scenarios.

  • 4 min read
  • Difficulty: Mixed (Medium → Hard)
  • 2+ yrs · SDET / Automation Lead
  • Updated July 1970
  • Avinash Kamble

1. Core Differences

Easy Very Common 1 min read

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. 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.

Medium Very Common 1 min read

Q2.Which is faster?

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.

Easy Very Common 1 min read

Q3.Which supports more languages?

Selenium: Java, Python, C#, Ruby, JavaScript, Kotlin. Playwright: TypeScript/JavaScript, Python, Java, .NET. Selenium wins on Ruby; Playwright wins on TypeScript ergonomics.

Easy Very Common 1 min read

Q4.Which supports more browsers?

BrowserSeleniumPlaywright
Chrome / EdgeYesYes (bundled Chromium)
FirefoxYesYes (bundled)
SafariYes (SafariDriver)WebKit engine (not Safari itself)
IE 11Yes (legacy)No
Mobile emulationBasicRich device profiles
Medium Very Common 1 min read

Q5.Which one auto-waits?

Playwright — every action waits for visible + stable + enabled + receiving-events before firing. Selenium requires explicit waits (WebDriverWait + ExpectedConditions).

Medium Very Common 1 min read

Q6.Which handles multi-tab / multi-window better?

Playwright — first-class BrowserContext and page.context().pages(). Selenium supports it via getWindowHandles(), but the API is more verbose and less isolated.

Confidence check

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

Easy Very Common 1 min read

Q7.Explain the architecture difference.

Selenium: Test → JSON Wire / W3C over HTTP → BrowserDriver → Browser. Each command is an HTTP round-trip. Playwright: Test → single WebSocket → Playwright driver → Browser (via CDP for Chromium, patched WebKit/Firefox). Fewer hops = lower per-command latency.

Medium Very Common 1 min read

Q8.Installation — which is faster?

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.

Medium Very Common 1 min read

Q9.Does Playwright need a Selenium-style Grid?

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.

Medium Very Common 1 min read

Q10.How do you write a login test in each?

// Playwright
await page.goto('/login');
await page.getByLabel('Email').fill('qa@x.com');
await page.getByLabel('Password').fill('secret');
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page).toHaveURL('/dashboard');
// Selenium (Java + JUnit)
driver.get("/login");
driver.findElement(By.id("email")).sendKeys("qa@x.com");
driver.findElement(By.id("password")).sendKeys("secret");
driver.findElement(By.id("submit")).click();
new WebDriverWait(driver, Duration.ofSeconds(10))
    .until(ExpectedConditions.urlContains("/dashboard"));
Medium Common 1 min read

Q11.How do you handle SPA loading?

Playwright: auto-waits for domcontentloaded/networkidle. Selenium: explicit wait on a stable element or URL change. Never rely on pageLoadTimeout alone for SPAs.

Confidence check

If you can confidently answer the Architecture & Setup 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.

3. Waits, Locators & Assertions

Medium Common 1 min read

Q12.Compare the locator APIs.

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.

Medium Common 1 min read

Q13.What is Playwright's expect() vs Selenium assertions?

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.

Medium Common 1 min read

Q14.How do you handle iframes in each?

// Playwright
const frame = page.frameLocator('#pay');
await frame.getByRole('button', { name: 'Pay' }).click();
// Selenium
driver.switchTo().frame("pay");
driver.findElement(By.id("pay-btn")).click();
driver.switchTo().defaultContent();
Medium Common 1 min read

Q15.How do you assert an element is hidden?

// Playwright — auto-retrying
await expect(page.getByTestId('spinner')).toBeHidden();
// Selenium
new WebDriverWait(driver, Duration.ofSeconds(10))
  .until(ExpectedConditions.invisibilityOfElementLocated(By.id("spinner")));
Medium Common 1 min read

Q16.Which is more resilient to flaky tests?

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.

Medium Common 1 min read

Q17.How do you run tests in parallel in each?

// Playwright — parallel by default; tune workers
// playwright.config.ts
export default { workers: 4 };
<!-- TestNG suite -->
<suite name="R" parallel="methods" thread-count="8">

Selenium also needs a ThreadLocal<WebDriver> to keep sessions isolated.

Confidence check

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.

4. Parallelism, Network & Tracing

Medium Common 1 min read

Q18.How do you intercept / mock network calls?

// Playwright — first-class
await page.route('**/api/users', r => r.fulfill({ json: [{ id: 1 }] }));

Selenium has to use Selenium 4 CDP (DevTools) or a proxy like BrowserMob — clunkier and Chromium-only.

Medium Common 1 min read

Q19.How do you debug a failed test?

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.

Easy Occasional 1 min read

Q20.Which produces better reports?

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.

Easy Occasional 1 min read

Q21.Which one supports mobile app automation?

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.

Easy Occasional 1 min read

Q22.How do you handle CAPTCHA / OAuth pop-ups?

Same strategy in both: bypass in test environments (test-mode CAPTCHA keys, direct-grant OAuth flows, seeded sessions). Neither tool magically solves CAPTCHAs.

Confidence check

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.

5. Choosing, Migrating & Career

Easy Occasional 1 min read

Q23.When should I still choose Selenium in 2026?

  • 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
Easy Occasional 1 min read

Q24.When should I pick Playwright?

  • 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

Deep dive: Playwright vs Selenium (2026 comparison).

Medium Occasional 1 min read

Q25.How would you migrate a Selenium suite to Playwright?

  1. Freeze new Selenium test additions
  2. Port page objects one-by-one, keeping data models
  3. Replace explicit waits with Playwright's auto-wait + expect
  4. Add trace: 'on-first-retry' from day one
  5. Run both suites in CI until parity, then delete Selenium
Easy Occasional 1 min read

Q26.Which one gets you hired faster in 2026?

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.

Confidence check

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

  1. 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.
  2. Q2: Which is faster — Playwright — often 2–5x on the same suite.
  3. Q3: Which supports more languages — Selenium : Java, Python, C#, Ruby, JavaScript, Kotlin.
  4. Q4: Which supports more browsers — 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 Mob
  5. Q5: Which one auto-waits — Playwright — every action waits for visible + stable + enabled + receiving-events before firing.

Frequently asked questions

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.

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.

Playwright — auto-wait removes the most confusing part of Selenium (waits), and the trace viewer makes debugging feel like a superpower.

Yes — SDET loops routinely ask you to justify a framework choice for a given system. Prep both sides.

Was this article helpful?

Cluster · QA Career

More from QA Interview Questions

Behavioral, framework, coding — full interview prep.

Pillar guide · 10 articles
More in this cluster
From the QA Career pillar

Key takeaways

  • Master the fundamentals before tackling advanced Playwright vs Selenium scenarios.
  • Always explain trade-offs — interviewers reward judgement, not memorisation.
  • Use real project examples; generic answers blend in.
  • Practice answers out loud — written prep doesn't transfer to live rounds.
  • Revise the 30-second cheat sheet the night before your interview.
  • Keep one strong scenario story ready for every section above.

These Questions Are Just the Start

Get 1000+ more with detailed model answers in our QA Interview Preparation Kit. Covers manual testing, automation, API, SQL, Selenium, Playwright, and framework concepts — everything asked in real QA interviews.

Get Interview Kit — ₹1,045

Playwright vs Selenium jobs hiring now

Live, indexable Playwright vs Selenium openings — updated daily in Jobs Radar.

Browse all QA jobs on Jobs Radar

Loading current openings…

Home