SoftwareTestPilot
25 Q&A

Playwright Interview Questions for Experienced QA and SDETs (25 with Answers)

25 Playwright interview questions for experienced testers (3+ years): framework architecture, fixtures, parallelism, sharding, flaky test strategy, CI, visual and accessibility testing, with code.

  • 10 min read
  • Difficulty: Mixed (Easy → Hard)
  • Freshers → Experienced
  • Updated October 16, 2026
  • SoftwareTestPilot
SoftwareTestPilot
QA Editorial Team
Published:
0 / 25 reviewed
0%

1. Playwright Architecture and Internals

Medium Very Common 1 minQ1 / 25

Q1.How does Playwright work under the hood, and why is it faster than Selenium WebDriver?

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

Hands-on "how would you Playwright work under the hood, and why is it faster than Selenium WebDriver" questions reveal whether you've actually shipped Playwright 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

Answer: Playwright talks to browsers over a persistent connection using each engine's debugging protocol (Chromium's CDP, and patched protocols for Firefox and WebKit), rather than sending a separate HTTP request per command as classic WebDriver does. Commands and browser events flow over one channel, which reduces round trips and lets Playwright listen to network and page events directly. Speed in real suites also comes from auto-waiting (fewer manual waits and retries) and cheap browser contexts for isolation. I'd avoid saying it is "always faster"; slow apps and bad tests are slow in any tool.

Tips to remember
  • Walk through Playwright work under the hood, and why is it faster than Selenium WebDriver as numbered steps and call out the tool, command, or API used at each step.
  • The full Playwright work under the hood, and why is it faster than Selenium WebDriver answer is long — rehearse a 45-second version that still lands definition, example, trade-off.
  • State that you never mix wait strategies and never use a hard sleep, then give the timeout value you actually run in CI.
RelatedQ3
Hard Very Common 1 minQ2 / 25

Q2.What is a browser context and why does it matter for test design?

Asked byGoogleAirbnbShopifyUber
Why interviewers ask this

Interviewers open with "browser context and why does it matter for test design" to confirm you can define the concept in one crisp line before going deeper. In Playwright rounds this filters out candidates who only remember syntax and can't articulate the underlying idea to a non-expert teammate.

Detailed explanation

Answer: A browser context is an isolated session inside one browser instance — like a fresh incognito profile with its own cookies, storage and cache. Creating one takes milliseconds, so Playwright Test gives every test a new context by default. That isolation is what makes parallel tests safe, and it lets one test simulate two users at once.

test('admin approval reaches the user', async ({ browser }) => {
  const adminCtx = await browser.newContext({ storageState: 'playwright/.auth/admin.json' });
  const userCtx = await browser.newContext({ storageState: 'playwright/.auth/user.json' });
  const admin = await adminCtx.newPage();
  const user = await userCtx.newPage();

  await admin.goto('/admin/requests');
  await admin.getByRole('row', { name: /REQ-204/ }).getByRole('button', { name: 'Approve' }).click();

  await user.goto('/requests/REQ-204');
  await expect(user.getByText('Approved')).toBeVisible();

  await adminCtx.close();
  await userCtx.close();
});
Tips to remember
  • Open with a one-sentence definition of browser context and why does it matter for test design, then a concrete Playwright example — never start with history or theory.
  • Be ready to whiteboard the browser context and why does it matter for test design 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.
Medium Very Common 1 minQ3 / 25

Q3.Explain how Playwright Test runs tests in parallel.

Asked byUberStripeMicrosoftAdobe
Why interviewers ask this

Open-ended "explain how Playwright Test runs tests in parallel" 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

Answer: The runner starts several worker processes (controlled by workers). Each worker is a separate OS process with its own browser. By default, files run in parallel and tests inside a file run in order in the same worker; fullyParallel: true lets tests within a file run in parallel too. Workers never share memory, so anything shared — a database row, a user account, a file — must be isolated by the test design, not by the tool.

Tips to remember
  • Use a 3-part frame for how Playwright Test runs tests in parallel: what it is → how it works → one gotcha you've hit in a real Playwright project.
  • Be ready to whiteboard the how Playwright Test runs tests in parallel 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.
Hard Very Common 1 minQ4 / 25

Q4.How does auto-waiting work, and where does it not help?

Asked byShopifyUberStripeMicrosoft
Why interviewers ask this

Hands-on "how would you auto-waiting work, and where does it not help" questions reveal whether you've actually shipped Playwright 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

Answer: Before an action such as click(), Playwright runs actionability checks — the element is attached, visible, stable, enabled and receives events — and retries until they pass or the timeout ends. Web-first assertions such as toBeVisible() or toHaveText() also retry. It does not help when the test checks the wrong thing: reading a value once with textContent() and asserting on it, or racing a background job the UI doesn't show. In those cases I wait on a real signal: an assertion, a response, or polling with expect.poll().

// Poll an API until a background job finishes
await expect.poll(async () => {
  const res = await request.get('/api/exports/77');
  return (await res.json()).status;
}, { timeout: 30_000 }).toBe('done');
Tips to remember
  • Walk through auto-waiting work, and where does it not help as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the auto-waiting work, and where does it not help 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.
Medium Very Common 1 minQ5 / 25

Q5.When would you choose Playwright over Cypress or Selenium for a new project?

Asked byMicrosoftAdobeNetflixGoogle
Why interviewers ask this

Timing questions like this check whether you understand the trade-offs of choose Playwright over Cypress or Selenium for a new project. 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

Answer: I'd choose Playwright when the team needs Chromium, Firefox and WebKit coverage, multiple tabs or users in one test, built-in parallelism and traces, and is comfortable in TypeScript or another supported language. Selenium still makes sense for large existing Java suites or grids, and Cypress for teams already invested in its ecosystem. The deciding factors are team skills, existing investment and browser needs — not hype. Our Playwright vs Selenium comparison covers the details.

Tips to remember
  • Answer in the form "Use choose Playwright over Cypress or Selenium for a new project when …, avoid it when …" so the interviewer hears both sides in one breath.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise choose Playwright over Cypress or Selenium for a new project cleanly.
  • Call out test isolation and shared-state risk (data, sessions, ports) before you talk about worker counts.
Confidence check

If you can confidently answer the Playwright Architecture and Internals 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. Framework Design: Fixtures, Page Objects and Data

Medium Very Common 1 minQ6 / 25

Q6.How do you structure a Playwright framework for a large product?

Asked byStripeMicrosoftAdobeNetflix
Why interviewers ask this

Hands-on "how would you structure a Playwright framework for a large product" questions reveal whether you've actually shipped Playwright 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

Answer: I use clear layers, each with one job:

  • Config — environments, projects per browser or device, reporters, retries.
  • Fixtures — signed-in pages, API clients, test data with cleanup.
  • Page objects / components — locators and user actions, no test logic.
  • Test data builders — unique, valid data created through the API.
  • Tests — short, readable, tagged (@smoke, @regression).
  • CI — sharded runs, merged reports, artefacts on failure.

I keep the folder structure by feature, not by file type, once the suite grows past a few hundred tests, so a team owns its folder end to end.

Tips to remember
  • Walk through structure a Playwright framework for a large product as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the structure a Playwright framework for a large product snippet live — panels often ask you to type it, not describe it.
  • Add one sentence on what does NOT belong in a page object (assertions, test data) — that boundary is what separates mid from senior answers.
Hard Very Common 1 minQ7 / 25

Q7.Fixtures or beforeEach hooks — which do you prefer and why?

Asked byNetflixGoogleAirbnbShopify
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Fixtures or beforeEach hooks — which do you prefer and why 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

Answer: Fixtures. They are set up only for tests that ask for them, they bundle setup and teardown in one place (code after use() always runs), they compose (a fixture can depend on other fixtures), and they can be test-scoped or worker-scoped. Hooks run for every test in scope whether needed or not, and teardown is easy to forget.

import { test as base } from '@playwright/test';
import { CheckoutPage } from './pages/checkout-page';

type Fixtures = { checkout: CheckoutPage };

export const test = base.extend<Fixtures>({
  checkout: async ({ page }, use) => {
    const checkout = new CheckoutPage(page);
    await checkout.open();
    await use(checkout);
  },
});
export { expect } from '@playwright/test';

More patterns are in our Playwright fixtures deep dive.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Fixtures or beforeEach hooks — which do you prefer and why over textbook wording.
  • Be ready to whiteboard the Fixtures or beforeEach hooks — which do you prefer and why 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.
Medium Very Common 1 minQ8 / 25

Q8.What is a worker-scoped fixture and when would you use one?

Asked byAdobeNetflixGoogleAirbnb
Why interviewers ask this

Interviewers open with "worker-scoped fixture and when would you use one" to confirm you can define the concept in one crisp line before going deeper. In Playwright rounds this filters out candidates who only remember syntax and can't articulate the underlying idea to a non-expert teammate.

Detailed explanation

Answer: It is created once per worker process and shared by all tests that worker runs. I use it for expensive, read-only setup — for example, one test account per worker, so parallel workers never fight over the same user.

export const test = base.extend<{}, { workerUser: { email: string } }>({
  workerUser: [async ({}, use, workerInfo) => {
    const email = `qa+w${workerInfo.workerIndex}@example.com`;
    // create or reset the account through the API here
    await use({ email });
  }, { scope: 'worker' }],
});
Tips to remember
  • Open with a one-sentence definition of worker-scoped fixture and when would you use one, then a concrete Playwright example — never start with history or theory.
  • Be ready to whiteboard the worker-scoped fixture and when would you use one 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.
Medium Very Common 1 minQ9 / 25

Q9.Do you put assertions inside page objects?

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Do you put assertions inside page objects 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

Answer: Mostly no. Page objects should describe what a user can do (addToCart(), applyCoupon()) and expose locators; the test decides what to check. Hiding assertions in page objects makes failures harder to read and tests harder to reuse. A small exception I allow: a waitUntilLoaded() method that asserts the page is ready, because that is navigation, not the behaviour under test. I also avoid deep inheritance; composition of small component objects (header, table, modal) ages better. See our Page Object Model in TypeScript guide.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Do you put assertions inside page objects over textbook wording.
  • Be ready to whiteboard the Do you put assertions inside page objects snippet live — panels often ask you to type it, not describe it.
  • Add one sentence on what does NOT belong in a page object (assertions, test data) — that boundary is what separates mid from senior answers.
Medium Common 1 minQ10 / 25

Q10.How do you manage test data at scale?

Asked byGoogleAirbnbShopifyUber
Why interviewers ask this

Hands-on "how would you manage test data at scale" questions reveal whether you've actually shipped Playwright 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

Answer: Every test creates the data it needs through the API, with unique values, and removes it in fixture teardown. Shared seed data is read-only. For things that are slow to create, I use worker-scoped fixtures. I never depend on the order tests run in. This is what makes fullyParallel and sharding safe.

Tips to remember
  • Walk through manage test data at scale as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the manage test data at scale 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.
Confidence check

If you can confidently answer the Framework Design: Fixtures, Page Objects and Data 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. Scaling, CI and Performance of the Suite

Medium Common 1 minQ11 / 25

Q11.Your suite takes 70 minutes in CI. How do you bring it down?

Asked byUberStripeMicrosoftAdobe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Your suite takes 70 minutes in CI. How do you bring it down 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

Answer: I measure first: the HTML report and a JSON reporter show the slowest tests and files. Then, in order of impact:

  1. Replace UI login with storageState from a setup project.
  2. Create data through the API instead of clicking through the UI.
  3. Remove fixed waits.
  4. Make tests independent, then enable fullyParallel.
  5. Shard across CI machines with --shard.
  6. Run a fast @smoke subset on every pull request and the full suite on merge or nightly.

I'd also check whether some UI tests should really be API or component tests.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Your suite takes 70 minutes in CI. How do you bring it down over textbook wording.
  • Be ready to whiteboard the Your suite takes 70 minutes in CI. How do you bring it down 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.
Medium Common 1 minQ12 / 25

Q12.How does sharding work, and how do you get one report from many shards?

Asked byShopifyUberStripeMicrosoft
Why interviewers ask this

Hands-on "how would you sharding work, and how do you get one report from many shards" questions reveal whether you've actually shipped Playwright 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

Answer: npx playwright test --shard=1/4 runs a quarter of the tests on one machine. Each shard writes a blob report, and a final job merges them.

# GitHub Actions (simplified)
strategy:
  matrix:
    shard: [1/4, 2/4, 3/4, 4/4]
steps:
  - run: npx playwright test --shard=${{ matrix.shard }} --reporter=blob
  - uses: actions/upload-artifact@v4
    with: { name: blob-${{ strategy.job-index }}, path: blob-report }
# merge job:
#   npx playwright merge-reports --reporter=html ./all-blob-reports

With fullyParallel on, sharding splits at test level, which balances shards better than file-level splitting.

Tips to remember
  • Walk through sharding work, and how do you get one report from many shards as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the sharding work, and how do you get one report from many shards 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.
Medium Common 1 minQ13 / 25

Q13.How do you decide how many workers to use?

Asked byMicrosoftAdobeNetflixGoogle
Why interviewers ask this

Hands-on "how would you decide how many workers to use" questions reveal whether you've actually shipped Playwright 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

Answer: Start with the CPU count of the CI machine (or half of it for heavy apps), then measure. More workers stop helping when the machine or the test environment becomes the bottleneck — CPU, memory, or a backend that can't handle the load — and flakiness rises. Often the better move is more shards on more machines rather than more workers on one.

Tips to remember
  • Walk through decide how many workers to use 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 decide how many workers to use cleanly.
  • Quote a real flake-rate number before and after your fix; measured outcomes score far higher than "we added retries".
Medium Common 1 minQ14 / 25

Q14.How do you configure different environments and browsers?

Asked byStripeMicrosoftAdobeNetflix
Why interviewers ask this

Hands-on "how would you configure different environments and browsers" questions reveal whether you've actually shipped Playwright 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

Answer: Read the environment from a variable and use projects for browser and device coverage. Each project can have its own use settings and test filters.

export default defineConfig({
  use: { baseURL: process.env.BASE_URL, trace: 'on-first-retry' },
  projects: [
    { name: 'setup', testMatch: /.*\.setup\.ts/ },
    { name: 'chromium', use: { ...devices['Desktop Chrome'], storageState: 'playwright/.auth/user.json' }, dependencies: ['setup'] },
    { name: 'mobile-safari', use: { ...devices['iPhone 13'], storageState: 'playwright/.auth/user.json' }, dependencies: ['setup'], grep: /@smoke/ },
  ],
});
Tips to remember
  • Walk through configure different environments and browsers as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the configure different environments and browsers snippet live — panels often ask you to type it, not describe it.
  • Explain setup/teardown ordering and what runs per-test vs per-suite; ordering mistakes are the follow-up question.
Medium Common 1 minQ15 / 25

Q15.What do you report and keep from CI runs?

Asked byNetflixGoogleAirbnbShopify
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on What do you report and keep from CI runs 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

Answer: The HTML report, traces and screenshots for failures (trace: 'on-first-retry', screenshot: 'only-on-failure'), and a JUnit or JSON report for dashboards. Over time I track total runtime, pass rate, and the list of tests marked flaky. Artefacts are what let anyone debug a CI failure without rerunning it.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on What do you report and keep from CI runs over textbook wording.
  • Be ready to whiteboard the What do you report and keep from CI runs snippet live — panels often ask you to type it, not describe it.
  • Quote a real flake-rate number before and after your fix; measured outcomes score far higher than "we added retries".
Confidence check

If you can confidently answer the Scaling, CI and Performance of the Suite 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. Flakiness, Quality and Strategy

Medium Common 1 minQ16 / 25

Q16.How do you run a flaky-test strategy for a team?

Asked byAdobeNetflixGoogleAirbnb
Why interviewers ask this

Hands-on "how would you run a flaky-test strategy for a team" questions reveal whether you've actually shipped Playwright 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

Answer: I treat flakiness as a tracked number. Playwright labels tests that fail then pass on retry as flaky; I collect that from reports each week. The top offenders get an owner and a fix date. If a test can't be fixed quickly, I quarantine it with a tag so it runs separately and doesn't block merges, with a limit on how long it can stay there. Retries stay low (1–2 in CI) so they reveal problems instead of hiding them.

Tips to remember
  • Walk through run a flaky-test strategy for a team 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 run a flaky-test strategy for a team cleanly.
  • Quote a real flake-rate number before and after your fix; measured outcomes score far higher than "we added retries".
Medium Common 1 minQ17 / 25

Q17.What are the most common root causes of flakiness you've seen?

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

Interviewers open with "most common root causes of flakiness you've seen" to confirm you can define the concept in one crisp line before going deeper. In Playwright rounds this filters out candidates who only remember syntax and can't articulate the underlying idea to a non-expert teammate.

Detailed explanation

Answer: In my experience: checking state too early instead of using web-first assertions; shared test data between parallel tests; tests depending on run order; animations and timers; third-party services in the path; and environments that are slow or under-resourced. Naming causes in this order — test design first, environment second — shows you look at your own code before blaming the tool.

Tips to remember
  • Open with a one-sentence definition of most common root causes of flakiness you've seen, then a concrete Playwright example — never start with history or theory.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise most common root causes of flakiness you've seen cleanly.
  • Quote a real flake-rate number before and after your fix; measured outcomes score far higher than "we added retries".
Medium Common 1 minQ18 / 25

Q18.How would you add visual regression testing without drowning in false failures?

Asked byGoogleAirbnbShopifyUber
Why interviewers ask this

Hands-on "how would you add visual regression testing without drowning in false failures" questions reveal whether you've actually shipped Playwright 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

Answer: Use toHaveScreenshot() on a small set of stable, high-value pages or components, not every screen. Mask dynamic content, disable animations, generate baselines in the same OS and browser as CI (usually a Docker image), and allow a small pixel threshold.

await expect(page).toHaveScreenshot('pricing.png', {
  mask: [page.getByTestId('live-clock')],
  animations: 'disabled',
  maxDiffPixelRatio: 0.01,
});

Our visual regression testing guide goes deeper.

Tips to remember
  • Walk through add visual regression testing without drowning in false failures as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the add visual regression testing without drowning in false failures snippet live — panels often ask you to type it, not describe it.
  • Mention pinned browser images and cleanup of containers between runs — panels look for CI cost awareness.
Hard Occasional 1 minQ19 / 25

Q19.How do you include accessibility checks in Playwright tests?

Asked byUberStripeMicrosoftAdobe
Why interviewers ask this

Hands-on "how would you include accessibility checks in Playwright tests" questions reveal whether you've actually shipped Playwright 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

Answer: Role-based locators already push tests toward accessible markup. For automated rule checks, I use the @axe-core/playwright package on key pages and fail on serious or critical violations. Automated checks catch only part of accessibility issues, so I say clearly that they complement, not replace, manual review.

import AxeBuilder from '@axe-core/playwright';

test('checkout has no serious a11y violations', async ({ page }) => {
  await page.goto('/checkout');
  const results = await new AxeBuilder({ page }).withTags(['wcag2a', 'wcag2aa']).analyze();
  const serious = results.violations.filter((v) => ['serious', 'critical'].includes(v.impact ?? ''));
  expect(serious).toEqual([]);
});
Tips to remember
  • Walk through include accessibility checks in Playwright tests as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the include accessibility checks in Playwright tests snippet live — panels often ask you to type it, not describe it.
  • Tie contract checks to the consumer/provider workflow and where the contract is stored — that's the senior detail panels wait for.
Medium Occasional 1 minQ20 / 25

Q20.How do you decide what to automate at the UI level versus API or unit level?

Asked byShopifyUberStripeMicrosoft
Why interviewers ask this

Hands-on "how would you decide what to automate at the UI level versus API or unit level" questions reveal whether you've actually shipped Playwright 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

Answer: UI tests are the slowest and most fragile, so I keep them for critical user journeys and things only the browser can prove — rendering, navigation, integration of front end and back end. Business rules with many combinations go to API or unit tests. I use Playwright's API testing for setup and for many backend checks; see our Playwright API testing interview questions.

Tips to remember
  • Walk through decide what to automate at the UI level versus API or unit level 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 decide what to automate at the UI level versus API or unit level cleanly.
  • Explain setup/teardown ordering and what runs per-test vs per-suite; ordering mistakes are the follow-up question.
Confidence check

If you can confidently answer the Flakiness, Quality and Strategy 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. Advanced Features and Leadership

Medium Occasional 1 minQ21 / 25

Q21.How do you write a custom assertion in Playwright?

Asked byMicrosoftAdobeNetflixGoogle
Why interviewers ask this

Hands-on "how would you write a custom assertion" questions reveal whether you've actually shipped Playwright 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

Answer: Extend expect with expect.extend(). I do this for domain checks repeated across many tests, so failures read in business terms.

import { expect as base, Locator } from '@playwright/test';

export const expect = base.extend({
  async toHavePrice(locator: Locator, expected: number) {
    const text = (await locator.textContent()) ?? '';
    const actual = Number(text.replace(/[^0-9.]/g, ''));
    return {
      pass: actual === expected,
      message: () => `expected price ${expected}, got ${actual} ("${text}")`,
      name: 'toHavePrice',
    };
  },
});
Tips to remember
  • Walk through write a custom assertion as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the write a custom assertion snippet live — panels often ask you to type it, not describe it.
  • Mention auto-waiting, user-facing locators, or trace viewer — one of those three usually earns a follow-up.
Medium Occasional 1 minQ22 / 25

Q22.How do you test features behind a feature flag or that depend on time?

Asked byStripeMicrosoftAdobeNetflix
Why interviewers ask this

Hands-on "how would you test features behind a feature flag or that depend on time" questions reveal whether you've actually shipped Playwright 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

Answer: For flags, I set them per test through an API or by mocking the flag service response with page.route(), so both states are covered. For time, Playwright's page.clock API can install a fake clock and set or advance time, which removes real waits for countdowns and session timeouts.

await page.clock.install({ time: new Date('2026-01-01T09:00:00') });
await page.goto('/session');
await page.clock.fastForward('30:00');
await expect(page.getByText('Your session has expired')).toBeVisible();
Tips to remember
  • Walk through test features behind a feature flag or that depend on time as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the test features behind a feature flag or that depend on time snippet live — panels often ask you to type it, not describe it.
  • Say when you'd mock versus hit the real dependency; unconditional mocking is a red flag for integration coverage.
Medium Occasional 1 minQ23 / 25

Q23.How would you migrate a large Selenium suite to Playwright?

Asked byNetflixGoogleAirbnbShopify
Why interviewers ask this

Hands-on "how would you migrate a large Selenium suite to Playwright" questions reveal whether you've actually shipped Playwright 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

Answer: Not with a big-bang rewrite. I'd start new tests in Playwright, migrate the most flaky or most valuable Selenium tests first, run both suites side by side in CI, and retire Selenium tests as Playwright equivalents prove stable. I'd agree locator and fixture conventions up front, pair with team members during the first weeks, and track runtime and flaky rate before and after, so the decision rests on data from our own suite.

Tips to remember
  • Walk through migrate a large Selenium suite to Playwright 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 migrate a large Selenium suite to Playwright cleanly.
  • Quote a real flake-rate number before and after your fix; measured outcomes score far higher than "we added retries".
Medium Occasional 1 minQ24 / 25

Q24.How do you review a teammate's Playwright pull request?

Asked byAdobeNetflixGoogleAirbnb
Why interviewers ask this

Hands-on "how would you review a teammate's Playwright pull request" questions reveal whether you've actually shipped Playwright 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

Answer: I check that the test is independent and creates its own data; locators are user-facing, not CSS chains; there are no fixed waits or force: true without a comment; assertions check behaviour, not implementation; and the test name says what it proves. I also run it locally with --repeat-each=10 to catch flakiness before it reaches main.

Tips to remember
  • Walk through review a teammate's Playwright pull request as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the review a teammate's Playwright pull request snippet live — panels often ask you to type it, not describe it.
  • Quote a real flake-rate number before and after your fix; measured outcomes score far higher than "we added retries".
Medium Occasional 1 minQ25 / 25

Q25.Tell me about a framework decision you'd make differently now.

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Tell me about a framework decision you'd make differently now 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

Answer: This is a judgement question, so answer from your own work. A good shape: the decision ("we put assertions inside page objects"), the problem it caused ("failures were hard to read and tests were hard to reuse"), what you changed ("moved assertions into tests, kept page objects as actions"), and the result you actually measured. If you don't have a measured result, say what you observed — interviewers value honesty over polished numbers.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Tell me about a framework decision you'd make differently now over textbook wording.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise Tell me about a framework decision you'd make differently now cleanly.
  • Add one sentence on what does NOT belong in a page object (assertions, test data) — that boundary is what separates mid from senior answers.
RelatedQ23
Confidence check

If you can confidently answer the Advanced Features and Leadership 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: How does Playwright work under the hood, and why is it faster than Selenium WebDriver — Answer: Playwright talks to browsers over a persistent connection using each engine's debugging protocol (Chromium's CDP, and patched protocols for Firefox and WebKit), rather than
  2. Q2: What is a browser context and why does it matter for test design — Answer: A browser context is an isolated session inside one browser instance — like a fresh incognito profile with its own cookies, storage and cache.
  3. Q3: Explain how Playwright Test runs tests in parallel. — Answer: The runner starts several worker processes (controlled by workers ).
  4. Q4: How does auto-waiting work, and where does it not help — Answer: Before an action such as click() , Playwright runs actionability checks — the element is attached, visible, stable, enabled and receives events — and retries until they pas
  5. Q5: When would you choose Playwright over Cypress or Selenium for a new project — Answer: I'd choose Playwright when the team needs Chromium, Firefox and WebKit coverage, multiple tabs or users in one test, built-in parallelism and traces, and is comfortable in

Frequently asked questions

1.What Playwright questions are asked for experienced candidates?
Expect questions on Playwright architecture and browser contexts, framework design with fixtures and page objects, parallel execution and sharding, flaky test strategy, CI reporting, visual and accessibility testing, and migration from Selenium.
2.How are senior Playwright interviews different from fresher interviews?
Fresher interviews test definitions and basic syntax. Senior interviews test design decisions, trade-offs, scaling a suite in CI and leading quality practices across a team.
3.Should I prepare coding for an experienced Playwright interview?
Yes. Many rounds ask you to write a fixture, a page object or a test with mocking live, usually in TypeScript. Practise writing short, readable code without an IDE's autocomplete.
4.How many years of experience counts as experienced for Playwright roles?
It depends on the company, but questions like these usually appear for candidates with around three or more years of test automation experience, including time spent designing or maintaining a framework.
5.Is Playwright knowledge enough for an SDET role?
Usually not on its own. SDET roles also expect programming fundamentals, API testing, CI/CD, version control and some understanding of system design and test strategy.
6.How do I talk about framework achievements without exaggerating?
Describe the problem, what you changed and what you measured. If you lack exact numbers, describe what you observed. Interviewers often probe numbers, so only share ones you can explain.

Playwright automation jobs hiring now

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

Browse all QA jobs on Jobs Radar

Loading current openings…

Home

References

  1. 1
    Playwright: Fixtures— playwright.dev
  2. 2
    Playwright: Parallelism— playwright.dev
  3. 3
    Playwright: Sharding— playwright.dev
  4. 4
  5. 5
    Playwright: Best practices— playwright.dev

Discussion

Ask a question, share your experience, or correct us. Be kind — real people are reading.