Playwright Interview Questions

Check out 30 of the most common Playwright interview questions and take an AI-powered practice interview

E2E TestingCross-browserTypeScriptTest AutomationAPI Testing
30+
Questions
12
Basic
13
Intermediate
5
Advanced
Q1

What is Playwright and why has it become the industry standard over Cypress?

BasicFundamentals
+
Q2

How do you install Playwright and write your first test?

BasicSetup
+
Q3

What are locators in Playwright and why are they preferred over CSS/XPath selectors?

BasicLocators
+
Q4

How does Playwright's auto-waiting mechanism work?

BasicAuto-waiting
+
Q5

What is the difference between `page.locator()` and `page.$()`?

BasicLocators
+
Q6

How do you write assertions in Playwright tests?

BasicAssertions
+
Q7

How do you handle navigation and page loading in Playwright?

BasicNavigation
+
Q8

What are fixtures in Playwright Test?

BasicFixtures
+
Q9

What is a browser context and how does it differ from a page?

BasicBrowser Contexts
+
Q10

How do you take screenshots and record videos in Playwright?

BasicDebugging
+
Q11

How do you run Playwright tests in headed mode versus headless?

BasicExecution
+
Q12

What is the Playwright config file and what are its most important options?

BasicConfiguration
+
Q13

How do you intercept and mock network requests in Playwright?

IntermediateNetwork Interception
+
Q14

How do you implement the Page Object Model (POM) in Playwright?

IntermediatePatterns
+
Q15

How do you handle authentication across many tests efficiently?

IntermediateAuthentication
+
Q16

What is the trace viewer and how do you use it to debug flaky tests?

IntermediateDebugging
+
Q17

How do you run Playwright tests in parallel and what is sharding?

IntermediateParallelism
+
Q18

What is the difference between `test.describe.serial`, `test.describe.parallel`, and the default mode?

IntermediateParallelism
+
Q19

How does Playwright handle iframes and how do you interact with them?

IntermediateFrames
+
Q20

How do you use the Playwright API request fixture for API testing without a browser?

IntermediateAPI Testing
+
Q21

How do you handle file uploads and downloads in Playwright?

IntermediateFiles
+
Q22

What are some common causes of flaky Playwright tests and how do you fix them?

IntermediateFlakiness
+
Q23

How do you do visual regression testing with Playwright?

IntermediateVisual Testing
+
Q24

How do you handle mobile and responsive testing with Playwright?

IntermediateMobile
+
Q25

How do you organize a large Playwright test suite at a company like Razorpay or Flipkart?

IntermediateArchitecture
+
Q26

How do you write custom matchers and extend the expect API in Playwright?

AdvancedCustom Matchers
+
Q27

How do you do component testing with Playwright instead of just E2E?

AdvancedComponent Testing
+
Q28

How would you architect a Playwright test suite for a 10,000+ test microservices platform?

AdvancedArchitecture
+
Q29

How do you write a Playwright reporter or plugin for custom CI integration?

AdvancedPlugins
+
Q30

How do you handle authentication in a multi-tenant SaaS platform with Playwright?

AdvancedMulti-tenancy
+

Companies Hiring Playwright

Microsoft
Vercel
Postman
Razorpay
Swiggy
Flipkart
Atlassian

Salary Insights

Average in India
₹6-22 LPA

Frequently Asked Questions

Is Playwright better than Cypress in 2026?

For new projects, yes — Playwright wins on cross-browser support (true Firefox + WebKit, not just Chromium), multi-tab and multi-origin handling, native free parallelism, the trace viewer, and out-of-the-box TypeScript ergonomics. Cypress still has a slightly more polished local UI for casual single-test exploration and a strong plugin ecosystem developed over a longer history, but the gap has closed substantially and Playwright's UI mode (`--ui`) now matches or exceeds it. Most teams (Razorpay, Postman, Microsoft, Vercel, Atlassian, Flipkart, Swiggy) have either migrated or started new projects on Playwright. The Cypress vs Playwright debate is largely settled in 2026 — pick Playwright unless you have an existing Cypress suite that works fine and the migration cost outweighs the benefits. Cypress is not going away, and small teams already invested in it can stay productive, but for new SDET hires across India, Playwright proficiency is what employers screen for first.

How much does a Playwright/SDET engineer earn in India?

₹6-22 LPA in 2026 for QA automation engineers and SDETs with Playwright as a primary skill. Entry-level QA automation roles start at ₹6-9 LPA, mid-level SDET roles with 3-5 years of experience at ₹12-16 LPA, senior SDETs and QA leads with 6+ years at ₹18-22+ LPA. Principal/Staff SDETs at top product companies can reach ₹30+ LPA. Companies hiring heavily for Playwright skills include Razorpay, Postman, Flipkart QA teams, Swiggy, Microsoft India, Atlassian Bangalore, Vercel, Zoho, Freshworks, and most YC-backed startups in Bangalore. Roles that combine Playwright with strong TypeScript skills and CI/CD experience consistently pay 30-40% above pure manual QA roles.

Should I learn Playwright with TypeScript or JavaScript?

TypeScript, without question. Playwright's API is designed type-first — IDE autocomplete, parameter validation, fixture types, and Page Object Model refactors all work dramatically better with TypeScript. Custom matchers, fixtures, and reporters are far cleaner with proper generic types. Every Playwright job posting in India in 2026 expects TS familiarity. Even if your dev team writes the application in plain JavaScript, write your tests in TypeScript — Playwright's `tsconfig.json` is self-contained and runs `.ts` files directly without a separate build step.

Can Playwright replace Selenium completely?

For modern web apps, almost always yes. Selenium retains an edge in two scenarios: (1) testing on real mobile devices via Appium, where Playwright's mobile emulation is browser-only and cannot drive a real Android or iOS device, (2) supporting older browsers (Internet Explorer, very old Safari versions, niche embedded browsers) — Playwright supports only the three modern engines (Chromium, Firefox, WebKit). For 95% of web E2E needs in 2026, Playwright is faster, less flaky, and easier to maintain than Selenium. Migration patterns vary by team — some big-bang convert, others run both in parallel during transition and gate new test creation to Playwright only. The Selenium IDE record-and-playback tool is still useful for non-developers, but Playwright's Codegen (`npx playwright codegen`) covers similar ground while producing far better code.

How long does it take to learn Playwright if I know JavaScript?

Two to three weeks of dedicated practice to be productive — write your first useful tests in a day, master fixtures and Page Objects in a week, become comfortable with network interception, trace viewer, parallelism, and CI integration in two-to-three weeks. The skill that takes longest to develop is writing non-flaky tests at scale and architecting a suite that stays trustworthy as it grows past a few hundred tests — that comes from 6-12 months of real-world exposure to a large suite, debugging actual production-grade flakes, and learning when to mock vs hit real services. For interview prep, focus on locator strategies, the difference between locators and ElementHandle, network interception patterns, parallelism modes, and being able to walk through a debugging session in the trace viewer. The official Playwright docs are excellent and contain interactive examples — they are the best starting point. Pair them with hands-on practice on a real application (open-source or your own), not just isolated example sites.

Does Playwright work for mobile app testing?

Playwright tests mobile web (responsive sites and mobile browsers via device emulation), not native iOS or Android apps. For native app automation, you still need Appium, Detox (React Native), or platform-specific frameworks like Espresso (Android) / XCUITest (iOS). In India, most companies pair Playwright (for the web product) with Appium or BrowserStack App Live / Sauce Labs Real Devices (for native apps). Playwright's mobile emulation is excellent for catching responsive bugs, mobile-specific UI behavior, touch event handling, and small-viewport regressions — but is not a substitute for testing on a real device for performance characteristics, native gesture interactions, or hardware-dependent features like Camera, Bluetooth, NFC, biometric authentication, and push notifications. If your mobile web traffic is significant (which is true for most Indian consumer products), invest in Playwright mobile projects covering Pixel and iPhone profiles as a minimum.

Introduction

Playwright has overtaken Cypress as the default end-to-end testing framework in 2026. Built by the original Puppeteer team at Microsoft and released as open-source in 2020, it ships with first-class TypeScript support, parallel test execution out of the box, true cross-browser coverage (Chromium, Firefox, WebKit), and a trace viewer that has changed how teams debug flaky tests forever. Modern QA teams at Razorpay, Postman, Flipkart, Swiggy, and most Bangalore-based product startups now treat Playwright as the baseline expectation for SDET candidates — being unable to discuss locator strategies or the trace viewer in 2026 is the equivalent of not knowing async/await in a backend interview.

If you are interviewing for an SDET or QA automation role in India today, expect deep questions on locator strategies (getByRole, getByText, getByTestId — modern locators, not CSS selectors), Playwright's auto-waiting mechanism and why it eliminates the need for hardcoded sleeps, network interception via route/fulfill/abort, Page Object Model patterns combined with custom fixtures, parallel vs serial test execution, CI sharding across multiple GitHub Actions runners, and the inevitable comparison of Playwright vs Cypress vs Selenium. Companies hiring senior SDETs probe component testing with experimental_ct, mobile emulation, custom expect matchers, plugin/reporter authoring, and how you handle authentication state across hundreds of tests without re-logging-in every time.

This guide covers the 30 most-asked Playwright interview questions in 2026, grouped by difficulty. Each answer includes the underlying concept, modern best practices for Playwright 1.49+, real-world gotchas drawn from production Indian QA teams, and a TypeScript code example where it helps clarify the answer. We focus on what teams actually ask in interviews — not theoretical Playwright trivia or features you would only need to know if you were contributing to Playwright itself. By the end of this guide you should be able to walk into any SDET interview at a top Indian product company and confidently discuss architecture decisions, debug a flaky test using the trace viewer, and articulate why Playwright is the right choice for modern web E2E testing.