SoftwareTestPilot
33 Q&A

Playwright Interview Questions and Answers PDF: 30 Questions to Revise

Playwright interview questions and answers in a print-ready format: 30 questions on locators, auto-waiting, assertions, fixtures, API testing, CI and debugging, plus a 7-day PDF revision plan.

  • 9 min read
  • Difficulty: Mixed (Easy → Hard)
  • Freshers → Experienced
  • Updated November 2, 2026
  • SoftwareTestPilot
SoftwareTestPilot
QA Editorial Team
Published:
0 / 33 reviewed
0%

1. How to Get This as a PDF (and Which PDF to Choose)

Easy Very Common 1 minQ1 / 33

Q1.Option A: Save this page as a PDF (free)

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Option A: Save this page as a PDF (free) 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
  1. Open this article on a laptop or desktop.
  2. Press Ctrl+P (Windows/Linux) or Cmd+P (Mac).
  3. Choose Save as PDF as the destination and click Save.

On a phone, use the browser's Share menu and choose Print, then save. You get all 30 questions below in one file you can read on the train or mark up before your interview.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Option A: Save this page as a PDF (free) over textbook wording.
  • Group the Option A: Save this page as a PDF (free) points into 2–3 buckets so you can recall them under pressure without missing one.
  • Mention auto-waiting, user-facing locators, or trace viewer — one of those three usually earns a follow-up.
RelatedQ3
Medium Very Common 1 minQ2 / 33

Q2.Option B: The designed PDFs in the QA Notes Vault

Asked byGoogleAirbnbShopifyUber
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Option B: The designed PDFs in the QA Notes Vault 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

If you prefer a laid-out document with more questions and deeper explanations, these PDFs exist in our library. Each page shows a free preview of the opening pages before you decide:

These are part of the paid QA Notes Vault, not free downloads; the current price is shown on each page. Start with Option A. If you find yourself wanting more depth after working through it, the Vault PDFs are the next step.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Option B: The designed PDFs in the QA Notes Vault over textbook wording.
  • Group the Option B: The designed PDFs in the QA Notes Vault points into 2–3 buckets so you can recall them under pressure without missing one.
  • Mention auto-waiting, user-facing locators, or trace viewer — one of those three usually earns a follow-up.
Easy Very Common 1 minQ3 / 33

Q3.How to use any interview PDF well

Asked byUberStripeMicrosoftAdobe
Why interviewers ask this

Hands-on "how would you use any interview PDF well" 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

A PDF is a revision tool, not a replacement for practice. Read one section, close the file, and explain each answer out loud in your own words. Then write the code example in a real project and run it. Interviewers can usually tell within a minute whether a candidate has memorised a list or has actually used the tool.

Tips to remember
  • Walk through use any interview PDF well 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 use any interview PDF well cleanly.
  • Mention auto-waiting, user-facing locators, or trace viewer — one of those three usually earns a follow-up.
Confidence check

If you can confidently answer the How to Get This as a PDF (and Which PDF to Choose) 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. Playwright Basics (Questions 1 to 6)

Easy Very Common 1 minQ4 / 33

Q4.What is Playwright?

Asked byShopifyUberStripeMicrosoft
Why interviewers ask this

Interviewers open with "Playwright" 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: Playwright is an open-source framework from Microsoft for end-to-end testing of web applications. One API drives Chromium, Firefox and WebKit, and it supports TypeScript/JavaScript, Python, Java and .NET. Playwright Test is its built-in test runner, with parallel execution, fixtures, retries, reports and tracing included.

Tips to remember
  • Open with a one-sentence definition of Playwright, 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 Playwright cleanly.
  • Call out test isolation and shared-state risk (data, sessions, ports) before you talk about worker counts.
Medium Very Common 1 minQ5 / 33

Q5.Why do teams choose Playwright over Selenium?

Asked byMicrosoftAdobeNetflixGoogle
Why interviewers ask this

"Why" questions on teams choose Playwright over Selenium probe your reasoning, not your memory. Strong candidates connect the choice to a business or reliability outcome — flaky tests, slower feedback loop, or missed defects — instead of parroting a rule.

Detailed explanation

Answer: The main reasons are built-in auto-waiting, which removes most manual waits; fast, isolated browser contexts; a full test runner in the box; and strong debugging tools such as the trace viewer and UI mode. Selenium is still a good choice when a team has a large existing Java suite or needs a browser Playwright doesn't support. A balanced answer mentions both sides. Our Cypress vs Playwright comparison covers the trade-offs in more detail.

Tips to remember
  • Tie the "why" for teams choose Playwright over Selenium back to a measurable outcome — flake rate, execution time, defect leakage — instead of an opinion.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise teams choose Playwright over Selenium cleanly.
  • State that you never mix wait strategies and never use a hard sleep, then give the timeout value you actually run in CI.
Easy Very Common 1 minQ6 / 33

Q6.Explain browser, browser context and page.

Asked byStripeMicrosoftAdobeNetflix
Why interviewers ask this

Open-ended "explain browser, browser context and page" 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: A browser is one running browser process. A browser context is an isolated session inside it, like a fresh incognito profile with its own cookies and storage. A page is a single tab inside a context. Playwright Test gives every test a new context, so tests don't share login state or cookies.

Tips to remember
  • Use a 3-part frame for browser, browser context and page: what it is → how it works → one gotcha you've hit in a real Playwright project.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise browser, browser context and page cleanly.
  • Mention auto-waiting, user-facing locators, or trace viewer — one of those three usually earns a follow-up.
Medium Very Common 1 minQ7 / 33

Q7.How do you install Playwright and run your first test?

Asked byNetflixGoogleAirbnbShopify
Why interviewers ask this

Hands-on "how would you install Playwright and run your first test" 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: Run npm init playwright@latest, which creates the config, an example test and installs browsers. Then run npx playwright test. Use npx playwright test --ui for UI mode or --headed to watch the browser.

Tips to remember
  • Walk through install Playwright and run your first test as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the install Playwright and run your first test 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.
Hard Very Common 1 minQ8 / 33

Q8.What does playwright.config.ts control?

Asked byAdobeNetflixGoogleAirbnb
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on What does playwright.config.ts control 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: It holds shared settings: the test directory, timeouts, retries, number of workers, reporters, the base URL, and projects (for example one per browser or device). Keeping these settings in config rather than in tests makes the suite consistent and easy to change.

import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  testDir: './tests',
  retries: process.env.CI ? 2 : 0,
  use: { baseURL: 'https://staging.example.com', trace: 'on-first-retry' },
  projects: [
    { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
    { name: 'firefox', use: { ...devices['Desktop Firefox'] } },
  ],
});
Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on What does playwright.config.ts control over textbook wording.
  • Be ready to whiteboard the What does playwright.config.ts control 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 / 33

Q9.What is headless mode?

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

Interviewers open with "headless mode" 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: Headless means the browser runs without a visible window. It is the default for Playwright Test and is faster, so it suits CI. You run headed (--headed) when you want to watch a test locally.

Tips to remember
  • Open with a one-sentence definition of headless mode, then a concrete Playwright example — never start with history or theory.
  • Be ready to whiteboard the headless mode 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.
Confidence check

If you can confidently answer the Playwright Basics (Questions 1 to 6) 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. Locators and Auto-Waiting (Questions 7 to 12)

Medium Very Common 1 minQ10 / 33

Q10.Which locators does Playwright recommend?

Asked byGoogleAirbnbShopifyUber
Why interviewers ask this

Listing questions on Which locators does Playwright recommend 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

Answer: User-facing locators first: getByRole, getByLabel, getByPlaceholder, getByText, then getByTestId as a stable fallback. CSS and XPath still work but break more easily when the page structure changes. The locators guide lists this order.

await page.getByRole('button', { name: 'Sign in' }).click();
await page.getByLabel('Email').fill('qa@example.com');
await page.getByTestId('cart-count');
Tips to remember
  • Group the items into 2–3 categories before listing — panels remember structure, not raw counts.
  • Be ready to whiteboard the Which locators does Playwright recommend 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.
Easy Very Common 1 minQ11 / 33

Q11.What is the difference between a Locator and an ElementHandle?

Asked byUberStripeMicrosoftAdobe
Why interviewers ask this

Interviewers open with "difference between a Locator and an ElementHandle" 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 Locator is a description of how to find an element; Playwright finds it again every time you act on it, so it survives re-renders. An ElementHandle points to one specific DOM node and can go stale. Use locators; element handles are discouraged for normal tests.

Tips to remember
  • Open with a one-sentence definition of difference between a Locator and an ElementHandle, 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 difference between a Locator and an ElementHandle cleanly.
  • Mention auto-waiting, user-facing locators, or trace viewer — one of those three usually earns a follow-up.
Medium Very Common 1 minQ12 / 33

Q12.What is auto-waiting?

Asked byShopifyUberStripeMicrosoft
Why interviewers ask this

Interviewers open with "auto-waiting" 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: Before an action like click(), Playwright checks that the element is attached, visible, stable (not animating), enabled and able to receive events. It retries these checks until they pass or the timeout ends. This removes most need for manual waits.

Tips to remember
  • Open with a one-sentence definition of auto-waiting, then a concrete Playwright example — never start with history or theory.
  • Be ready to whiteboard the auto-waiting 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 minQ13 / 33

Q13.Why is waitForTimeout considered bad practice?

Asked byMicrosoftAdobeNetflixGoogle
Why interviewers ask this

"Why" questions on waitForTimeout considered bad practice probe your reasoning, not your memory. Strong candidates connect the choice to a business or reliability outcome — flaky tests, slower feedback loop, or missed defects — instead of parroting a rule.

Detailed explanation

Answer: A fixed sleep either waits too long, slowing the suite, or not long enough, causing random failures. It waits for time, not for a condition. Replace it with an action that auto-waits or a web-first assertion such as await expect(locator).toBeVisible().

Tips to remember
  • Tie the "why" for waitForTimeout considered bad practice back to a measurable outcome — flake rate, execution time, defect leakage — instead of an opinion.
  • Be ready to whiteboard the waitForTimeout considered bad practice 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 Common 1 minQ14 / 33

Q14.How do you handle a list and pick one item?

Asked byStripeMicrosoftAdobeNetflix
Why interviewers ask this

Hands-on "how would you handle a list and pick one item" 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: Narrow down with filtering instead of index-based XPath:

const row = page.getByRole('row').filter({ hasText: 'Order #1042' });
await row.getByRole('button', { name: 'Cancel' }).click();

Use .first(), .last() or .nth() only when position really is the thing being tested.

Tips to remember
  • Walk through handle a list and pick one item as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the handle a list and pick one item 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.
Easy Common 1 minQ15 / 33

Q15.What is strict mode in locators?

Asked byNetflixGoogleAirbnbShopify
Why interviewers ask this

Interviewers open with "strict mode in locators" 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: If a locator matches more than one element when you perform an action, Playwright throws an error instead of guessing. This protects you from clicking the wrong element. The fix is a more specific locator, not turning the check off. For hands-on practice, our Playwright locators guide goes deeper.

Tips to remember
  • Open with a one-sentence definition of strict mode in locators, 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 strict mode in locators cleanly.
  • Mention auto-waiting, user-facing locators, or trace viewer — one of those three usually earns a follow-up.
Confidence check

If you can confidently answer the Locators and Auto-Waiting (Questions 7 to 12) 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. Assertions (Questions 13 to 16)

Medium Common 1 minQ16 / 33

Q16.What are web-first assertions?

Asked byAdobeNetflixGoogleAirbnb
Why interviewers ask this

Interviewers open with "web-first assertions" 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: Assertions like toBeVisible, toHaveText and toHaveURL that retry automatically until the condition is true or the timeout ends. Because the page may still be updating, retrying assertions are far more reliable than reading a value once and comparing it.

await expect(page.getByRole('alert')).toHaveText('Saved');
await expect(page).toHaveURL(/\/dashboard/);
Tips to remember
  • Open with a one-sentence definition of web-first assertions, then a concrete Playwright example — never start with history or theory.
  • Be ready to whiteboard the web-first assertions 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 Common 1 minQ17 / 33

Q17.What is a soft assertion?

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

Interviewers open with "soft assertion" 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: expect.soft() records a failure but lets the test continue, so you see several problems in one run. The test is still marked as failed at the end. It is useful for checking many fields on one page.

Tips to remember
  • Open with a one-sentence definition of soft assertion, then a concrete Playwright example — never start with history or theory.
  • Be ready to whiteboard the soft 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.
Easy Common 1 minQ18 / 33

Q18.Why is expect(await locator.isVisible()).toBe(true) weaker than await expect(locator).toBeVisible() ?

Asked byGoogleAirbnbShopifyUber
Why interviewers ask this

"Why" questions on expect(await locator.isVisible()).toBe(true) weaker than await expect(locator).toBeVisible() probe your reasoning, not your memory. Strong candidates connect the choice to a business or reliability outcome — flaky tests, slower feedback loop, or missed defects — instead of parroting a rule.

Detailed explanation

Answer: The first reads visibility once with no retry, so it fails if the element appears a moment later. The second keeps retrying until the timeout. This is one of the most common interview "spot the bug" questions.

Tips to remember
  • Tie the "why" for expect(await locator.isVisible()).toBe(true) weaker than await expect(locator).toBeVisible() back to a measurable outcome — flake rate, execution time, defect leakage — instead of an opinion.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise expect(await locator.isVisible()).toBe(true) weaker than await expect(locator).toBeVisible() cleanly.
  • Mention auto-waiting, user-facing locators, or trace viewer — one of those three usually earns a follow-up.
Medium Common 1 minQ19 / 33

Q19.How do you wait for something that isn't on a page, like a background job?

Asked byUberStripeMicrosoftAdobe
Why interviewers ask this

Hands-on "how would you wait for something that isn't on a page, like a background job" 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 expect.poll, which calls a function repeatedly until its value matches:

await expect.poll(async () => {
  const res = await request.get('/api/reports/55');
  return (await res.json()).status;
}, { timeout: 30_000 }).toBe('ready');
Tips to remember
  • Walk through wait for something that isn't on a page, like a background job as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the wait for something that isn't on a page, like a background job 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.
Confidence check

If you can confidently answer the Assertions (Questions 13 to 16) 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. Fixtures, Hooks and Page Objects (Questions 17 to 21)

Medium Common 1 minQ20 / 33

Q20.What is a fixture in Playwright Test?

Asked byShopifyUberStripeMicrosoft
Why interviewers ask this

Interviewers open with "fixture in Playwright Test" 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 fixture is a piece of setup a test asks for by name, like page, context or request. Fixtures set up only what a test needs and clean up after it automatically. You can create your own with test.extend.

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

export const test = base.extend<{ loginPage: LoginPage }>({
  loginPage: async ({ page }, use) => {
    const loginPage = new LoginPage(page);
    await loginPage.goto();
    await use(loginPage);
  },
});
Tips to remember
  • Open with a one-sentence definition of fixture in Playwright Test, then a concrete Playwright example — never start with history or theory.
  • Be ready to whiteboard the fixture in Playwright Test 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.
Easy Common 1 minQ21 / 33

Q21.Fixtures or beforeEach hooks?

Asked byMicrosoftAdobeNetflixGoogle
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Fixtures or beforeEach hooks 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: Hooks are fine for simple setup inside one file. Fixtures are better for shared setup because they are reusable, run only when a test needs them, and keep setup and teardown together. Many teams use both. The fixtures deep dive shows worked examples.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Fixtures or beforeEach hooks over textbook wording.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise Fixtures or beforeEach hooks cleanly.
  • Explain setup/teardown ordering and what runs per-test vs per-suite; ordering mistakes are the follow-up question.
Medium Common 1 minQ22 / 33

Q22.What is the Page Object Model?

Asked byStripeMicrosoftAdobeNetflix
Why interviewers ask this

Interviewers open with "Page Object Model" 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 pattern where each page or component gets a class holding its locators and actions, such as login(email, password). Tests then read like user steps, and when the page changes you update one class instead of many tests.

Tips to remember
  • Open with a one-sentence definition of Page Object Model, then a concrete Playwright example — never start with history or theory.
  • Be ready to whiteboard the Page Object Model 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 minQ23 / 33

Q23.Should page objects contain assertions?

Asked byNetflixGoogleAirbnbShopify
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Should page objects contain assertions 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. Keeping assertions in the test makes it clear what each test checks. A small helper such as expectLoaded() is acceptable when the same check is used everywhere.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Should page objects contain assertions over textbook wording.
  • Be ready to whiteboard the Should page objects contain assertions 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 minQ24 / 33

Q24.How do you avoid logging in before every test?

Asked byAdobeNetflixGoogleAirbnb
Why interviewers ask this

Hands-on "how would you avoid logging in before every test" 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: Log in once in a setup project, save the session with storageState, and load that file in other tests. This saves time and keeps the login flow tested in one place.

// auth.setup.ts
await page.getByLabel('Email').fill(process.env.QA_USER!);
await page.getByLabel('Password').fill(process.env.QA_PASS!);
await page.getByRole('button', { name: 'Sign in' }).click();
await page.context().storageState({ path: 'playwright/.auth/user.json' });
Tips to remember
  • Walk through avoid logging in before every test as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the avoid logging in before every test 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.
Confidence check

If you can confidently answer the Fixtures, Hooks and Page Objects (Questions 17 to 21) 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.

6. API Testing and Network Control (Questions 22 to 24)

Medium Occasional 1 minQ25 / 33

Q25.Can Playwright test APIs?

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Can Playwright test APIs 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: Yes. The request fixture sends HTTP requests without a browser. It is useful for pure API tests and for creating test data quickly before a UI test.

test('creates a user', async ({ request }) => {
  const res = await request.post('/api/users', { data: { name: 'Asha' } });
  expect(res.status()).toBe(201);
  expect((await res.json()).name).toBe('Asha');
});
Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Can Playwright test APIs over textbook wording.
  • Be ready to whiteboard the Can Playwright test APIs 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 Occasional 1 minQ26 / 33

Q26.How do you mock an API response?

Asked byGoogleAirbnbShopifyUber
Why interviewers ask this

Hands-on "how would you mock an API response" 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 page.route() to intercept a request and return your own data. This helps test error states or empty lists that are hard to create on a real server.

await page.route('**/api/orders', route =>
  route.fulfill({ status: 500, json: { error: 'Server error' } })
);
await page.goto('/orders');
await expect(page.getByText('Something went wrong')).toBeVisible();
Tips to remember
  • Walk through mock an API response as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the mock an API response 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 minQ27 / 33

Q27.How do you wait for a specific network response?

Asked byUberStripeMicrosoftAdobe
Why interviewers ask this

Hands-on "how would you wait for a specific network response" 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 waiting before the action, then await the result, so you never miss a fast response:

const responsePromise = page.waitForResponse('**/api/search*');
await page.getByRole('button', { name: 'Search' }).click();
const response = await responsePromise;
expect(response.ok()).toBeTruthy();

To practise API questions against a real endpoint, try the free API Playground.

Tips to remember
  • Walk through wait for a specific network response as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the wait for a specific network response 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.
Confidence check

If you can confidently answer the API Testing and Network Control (Questions 22 to 24) 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.

7. Parallel Runs, CI and Debugging (Questions 25 to 28)

Medium Occasional 1 minQ28 / 33

Q28.How does Playwright run tests in parallel?

Asked byShopifyUberStripeMicrosoft
Why interviewers ask this

Hands-on "how would you Playwright run tests in parallel" 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: The runner starts several worker processes. By default, test files run in parallel and tests inside a file run in order. Setting fullyParallel: true runs individual tests in parallel too. Parallel runs only work well when tests don't share data or accounts.

Tips to remember
  • Walk through Playwright run tests in parallel as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the Playwright run 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.
Medium Occasional 1 minQ29 / 33

Q29.What is sharding?

Asked byMicrosoftAdobeNetflixGoogle
Why interviewers ask this

Interviewers open with "sharding" 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: Splitting the suite across machines with --shard=1/4, --shard=2/4 and so on. Each machine runs a part, and the blob reports can be merged into one HTML report with npx playwright merge-reports.

Tips to remember
  • Open with a one-sentence definition of sharding, then a concrete Playwright example — never start with history or theory.
  • Be ready to whiteboard the sharding 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.
Medium Occasional 1 minQ30 / 33

Q30.How do you debug a test that fails only in CI?

Asked byStripeMicrosoftAdobeNetflix
Why interviewers ask this

Hands-on "how would you debug a test that fails only in CI" 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: Turn on tracing for retries (trace: 'on-first-retry'), download the trace from the CI artifacts and open it with npx playwright show-trace. The trace shows each action, DOM snapshots, network calls and console logs, which usually reveals timing or data problems. Locally, --debug and UI mode let you step through.

Tips to remember
  • Walk through debug a test that fails only in CI as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the debug a test that fails only in CI 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.
Easy Occasional 1 minQ31 / 33

Q31.How do you deal with flaky tests?

Asked byNetflixGoogleAirbnbShopify
Why interviewers ask this

Hands-on "how would you deal with flaky 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: Find the cause instead of hiding it. Common causes are fixed sleeps, shared test data, weak locators and assertions that don't retry. Retries can keep CI moving while you fix things, but a test that passes only on retry should be tracked and fixed, not ignored.

Tips to remember
  • Walk through deal with flaky tests 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 deal with flaky tests cleanly.
  • 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 Parallel Runs, CI and Debugging (Questions 25 to 28) 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.

8. Scenario Questions (Questions 29 and 30)

Medium Occasional 1 minQ32 / 33

Q32.How would you test file upload and download?

Asked byAdobeNetflixGoogleAirbnb
Why interviewers ask this

Hands-on "how would you test file upload and download" 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 upload, use setInputFiles on the file input. For download, start waiting for the download event before clicking, then check the file name:

await page.getByLabel('Upload invoice').setInputFiles('fixtures/invoice.pdf');

const downloadPromise = page.waitForEvent('download');
await page.getByRole('button', { name: 'Export CSV' }).click();
const download = await downloadPromise;
expect(download.suggestedFilename()).toContain('.csv');
Tips to remember
  • Walk through test file upload and download as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the test file upload and download 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 Occasional 1 minQ33 / 33

Q33.How would you handle a new tab or popup?

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

Hands-on "how would you handle a new tab or popup" 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: Wait for the new page event on the context before the click that opens it, then work with the new page like any other:

const pagePromise = page.context().waitForEvent('page');
await page.getByRole('link', { name: 'Open help' }).click();
const helpPage = await pagePromise;
await expect(helpPage).toHaveTitle(/Help/);

Scenario questions test whether you can turn a requirement into steps and pick the right API. Talk through your thinking before writing code.

Tips to remember
  • Walk through handle a new tab or popup as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the handle a new tab or popup snippet live — panels often ask you to type it, not describe it.
  • Explain how you test asynchronous flows (polling, consumer assertions, timeouts) rather than treating it as a sync call.
RelatedQ31
Confidence check

If you can confidently answer the Scenario Questions (Questions 29 and 30) 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: Option A: Save this page as a PDF (free) — Open this article on a laptop or desktop.
  2. Q2: Option B: The designed PDFs in the QA Notes Vault — If you prefer a laid-out document with more questions and deeper explanations, these PDFs exist in our library.
  3. Q3: How to use any interview PDF well — A PDF is a revision tool, not a replacement for practice.
  4. Q4: What is Playwright — Answer: Playwright is an open-source framework from Microsoft for end-to-end testing of web applications.
  5. Q5: Why do teams choose Playwright over Selenium — Answer: The main reasons are built-in auto-waiting, which removes most manual waits; fast, isolated browser contexts; a full test runner in the box; and strong debugging tools such

Learn it properly

Playwright Automation course

Learn Playwright step by step with hands-on projects, graded section tests and a certificate.

  • Locators, fixtures, auto-wait
  • Real framework project
  • Certificate on completion

Preparing for this interview?

Playwright Automation Basics

8 hands-on lessons in about 45 minutes: install Playwright, record tests, write stable locators and assertions, mock the network, debug failures and finish a mini project.

Start the free course

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: Locators— playwright.dev
  2. 2
  3. 3
    Playwright: Assertions— playwright.dev
  4. 4
    Playwright: Fixtures— playwright.dev
  5. 5
    Playwright: Trace viewer— playwright.dev

Discussion

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