SoftwareTestPilot
25 Q&A

Playwright Scenario-Based Interview Questions and Answers (25 Real Scenarios)

25 Playwright scenario-based interview questions with model answers and code: flaky tests, auth reuse, network mocking, iframes, file uploads, parallel runs, CI failures and more.

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

1. Flaky Tests and Waiting

Hard Very Common 1 minQ1 / 25

Q1.A test passes locally but fails about 1 in 10 runs in CI with "element not visible". What do you do?

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on A test passes locally but fails about 1 in 10 runs in CI with "element not visible". What do you do 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: First I open the trace for a failing run to see what the page looked like at the moment of failure. The usual cause is that the test checks the page before the app has finished loading, often because of a manual check such as isVisible() that doesn't wait. I replace it with a web-first assertion, which retries until the condition is true or the timeout ends.

// Flaky: isVisible() returns immediately, no retry
expect(await page.getByRole('alert').isVisible()).toBe(true);

// Stable: retries until visible (default 5s expect timeout)
await expect(page.getByRole('alert')).toBeVisible();

To prevent it, I enable trace: 'on-first-retry' in the config so every CI failure comes with evidence, and I add a lint rule against waitForTimeout.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on A test passes locally but fails about 1 in 10 runs in CI with "element not visible". What do you do over textbook wording.
  • Be ready to whiteboard the A test passes locally but fails about 1 in 10 runs in CI with "element not visible". What do you do 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".
RelatedQ3
Medium Very Common 1 minQ2 / 25

Q2.A teammate added page.waitForTimeout(5000) to fix a flaky test. How do you respond?

Asked byGoogleAirbnbShopifyUber
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on A teammate added page.waitForTimeout(5000) to fix a flaky test. How do you respond 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: A fixed wait either wastes time on fast runs or still fails on slow ones. I ask what the test is really waiting for — a network response, a spinner disappearing, or text appearing — and wait for that instead.

// Wait for the API call the button triggers
const responsePromise = page.waitForResponse(
  (res) => res.url().includes('/api/orders') && res.status() === 200
);
await page.getByRole('button', { name: 'Place order' }).click();
await responsePromise;

// Or wait for the loading state to finish
await expect(page.getByTestId('spinner')).toBeHidden();
Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on A teammate added page.waitForTimeout(5000) to fix a flaky test. How do you respond over textbook wording.
  • Be ready to whiteboard the A teammate added page.waitForTimeout(5000) to fix a flaky test. How do you respond 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 Very Common 1 minQ3 / 25

Q3.A click sometimes does nothing because an overlay covers the button for a moment. How do you handle it?

Asked byUberStripeMicrosoftAdobe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on A click sometimes does nothing because an overlay covers the button for a moment. How do you handle it 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: Playwright's actionability checks already wait for the element to be visible, stable, enabled and to receive events. If the click still lands on the overlay, I wait for the overlay to go away with await expect(overlay).toBeHidden(). I avoid { force: true } because it skips those checks and can hide a real bug where users can't click the button either.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on A click sometimes does nothing because an overlay covers the button for a moment. How do you handle it over textbook wording.
  • Be ready to whiteboard the A click sometimes does nothing because an overlay covers the button for a moment. How do you handle it 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 Very Common 1 minQ4 / 25

Q4.Your suite has retries: 3 and most failures pass on retry. Is that acceptable?

Asked byShopifyUberStripeMicrosoft
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Your suite has retries: 3 and most failures pass on retry. Is that acceptable 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: Retries keep the pipeline moving but hide problems. Playwright marks tests that pass on retry as flaky in the report, so I track that number every week, fix the top offenders, and keep retries at 1 or 2 in CI and 0 locally.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Your suite has retries: 3 and most failures pass on retry. Is that acceptable over textbook wording.
  • Keep the answer to 60–90 seconds; anything longer signals you can't summarise Your suite has retries: 3 and most failures pass on retry. Is that acceptable 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 Flaky Tests and Waiting 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. Locators and Dynamic UI

Medium Very Common 1 minQ5 / 25

Q5.Developers keep changing CSS classes and your tests break every sprint. What do you change?

Asked byMicrosoftAdobeNetflixGoogle
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Developers keep changing CSS classes and your tests break every sprint. What do you change 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 move to user-facing locators that follow what the user sees, in this order: getByRole, getByLabel, getByText, then getByTestId for elements with no accessible name. I also agree a data-testid convention with developers for complex widgets.

// Brittle
await page.locator('.btn.btn-primary.mt-3').click();

// Resilient
await page.getByRole('button', { name: 'Save changes' }).click();
await page.getByLabel('Email').fill('qa@example.com');

More patterns are in our complete guide to Playwright locators.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Developers keep changing CSS classes and your tests break every sprint. What do you change over textbook wording.
  • Be ready to whiteboard the Developers keep changing CSS classes and your tests break every sprint. What do you change snippet live — panels often ask you to type it, not describe it.
  • Anchor the answer to a ceremony and an artefact (definition of done, story acceptance criteria) from a team you worked in.
Medium Very Common 1 minQ6 / 25

Q6.A table has 50 rows and you must click "Edit" on the row for "Order #1042". How?

Asked byStripeMicrosoftAdobeNetflix
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on A table has 50 rows and you must click "Edit" on the row for "Order #1042". How 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: Filter the rows by text, then find the button inside that row, so the test doesn't depend on row position.

const row = page.getByRole('row').filter({ hasText: 'Order #1042' });
await row.getByRole('button', { name: 'Edit' }).click();
Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on A table has 50 rows and you must click "Edit" on the row for "Order #1042". How over textbook wording.
  • Be ready to whiteboard the A table has 50 rows and you must click "Edit" on the row for "Order #1042". How 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 Very Common 1 minQ7 / 25

Q7.Your locator throws a "strict mode violation" error. What does it mean and how do you fix it?

Asked byNetflixGoogleAirbnbShopify
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Your locator throws a "strict mode violation" error. What does it mean and how do you fix it 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 locator matched more than one element, and Playwright refuses to guess which one to act on. I make the locator more specific (filter by text, scope it inside a parent region) rather than using .first(), because .first() silently picks the wrong element when the page order changes.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Your locator throws a "strict mode violation" error. What does it mean and how do you fix it over textbook wording.
  • Be ready to whiteboard the Your locator throws a "strict mode violation" error. What does it mean and how do you fix it 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 Very Common 1 minQ8 / 25

Q8.A search box shows suggestions as you type, and the list updates several times. How do you pick one reliably?

Asked byAdobeNetflixGoogleAirbnb
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on A search box shows suggestions as you type, and the list updates several times. How do you pick one reliably 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: Type the text, then wait for the exact option with an assertion before clicking it. The locator is re-evaluated each time, so it handles the list re-rendering.

await page.getByRole('combobox', { name: 'Search' }).fill('playwr');
const option = page.getByRole('option', { name: 'Playwright' });
await expect(option).toBeVisible();
await option.click();
Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on A search box shows suggestions as you type, and the list updates several times. How do you pick one reliably over textbook wording.
  • Be ready to whiteboard the A search box shows suggestions as you type, and the list updates several times. How do you pick one reliably 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 Locators and Dynamic UI 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. Login, Sessions and Multiple Users

Hard Very Common 1 minQ9 / 25

Q9.Every test logs in through the UI, adding about 8 seconds each. How do you speed this up?

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Every test logs in through the UI, adding about 8 seconds each. How do you speed this up 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: Log in once in a setup project, save the session with storageState, and let every test start already signed in.

// auth.setup.ts
import { test as setup, expect } from '@playwright/test';

setup('authenticate', async ({ page }) => {
  await page.goto('/login');
  await page.getByLabel('Email').fill(process.env.TEST_USER!);
  await page.getByLabel('Password').fill(process.env.TEST_PASS!);
  await page.getByRole('button', { name: 'Sign in' }).click();
  await expect(page.getByRole('link', { name: 'My account' })).toBeVisible();
  await page.context().storageState({ path: 'playwright/.auth/user.json' });
});

// playwright.config.ts (projects)
// { name: 'setup', testMatch: /.*\.setup\.ts/ },
// { name: 'chromium', use: { storageState: 'playwright/.auth/user.json' }, dependencies: ['setup'] }

I keep one UI login test so the login page itself is still covered, and I add the .auth folder to .gitignore so session files never reach the repository.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Every test logs in through the UI, adding about 8 seconds each. How do you speed this up over textbook wording.
  • Be ready to whiteboard the Every test logs in through the UI, adding about 8 seconds each. How do you speed this up 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.
Hard Common 1 minQ10 / 25

Q10.You need to test a chat between a buyer and a seller in the same test. How?

Asked byGoogleAirbnbShopifyUber
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on You need to test a chat between a buyer and a seller in the same test. How 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: Create two browser contexts. Each context is an isolated session with its own cookies, like two separate browsers.

test('buyer and seller chat', async ({ browser }) => {
  const buyer = await browser.newContext({ storageState: 'playwright/.auth/buyer.json' });
  const seller = await browser.newContext({ storageState: 'playwright/.auth/seller.json' });
  const buyerPage = await buyer.newPage();
  const sellerPage = await seller.newPage();

  await buyerPage.goto('/messages/seller-1');
  await buyerPage.getByRole('textbox', { name: 'Message' }).fill('Is this available?');
  await buyerPage.getByRole('button', { name: 'Send' }).click();

  await sellerPage.goto('/messages/buyer-1');
  await expect(sellerPage.getByText('Is this available?')).toBeVisible();

  await buyer.close();
  await seller.close();
});
Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on You need to test a chat between a buyer and a seller in the same test. How over textbook wording.
  • Be ready to whiteboard the You need to test a chat between a buyer and a seller in the same test. How 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 minQ11 / 25

Q11.The app uses OTP login by SMS. How would you automate tests behind login?

Asked byUberStripeMicrosoftAdobe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on The app uses OTP login by SMS. How would you automate tests behind login 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 wouldn't automate the real SMS. I'd ask the team for a test-only route: a fixed OTP in the test environment, an API that returns the latest code for a test number, or an endpoint that creates a session directly. Then I save that session with storageState. I'd test the real OTP screen with a mocked response, and leave the real SMS delivery to a small manual or monitoring check.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on The app uses OTP login by SMS. How would you automate tests behind login over textbook wording.
  • Be ready to whiteboard the The app uses OTP login by SMS. How would you automate tests behind login 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.
Confidence check

If you can confidently answer the Login, Sessions and Multiple Users 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. Network Mocking and API Testing

Medium Common 1 minQ12 / 25

Q12.A third-party payment sandbox is slow and often down, so your checkout tests fail for reasons outside your app. What do you do?

Asked byShopifyUberStripeMicrosoft
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on A third-party payment sandbox is slow and often down, so your checkout tests fail for reasons outside your app. What do you do 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: For UI tests, I mock the call with page.route() so the test checks our checkout behaviour, not the sandbox's uptime. I keep a separate, smaller set of tests against the real sandbox that runs nightly, so integration problems are still caught.

await page.route('**/api/payments/charge', (route) =>
  route.fulfill({
    status: 200,
    contentType: 'application/json',
    body: JSON.stringify({ status: 'captured', id: 'pay_test_123' }),
  })
);

The trade-off: mocks hide real API changes, so I keep mock data in line with the real API contract.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on A third-party payment sandbox is slow and often down, so your checkout tests fail for reasons outside your app. What do you do over textbook wording.
  • Be ready to whiteboard the A third-party payment sandbox is slow and often down, so your checkout tests fail for reasons outside your app. What do you do 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 Common 1 minQ13 / 25

Q13.How do you test that the UI shows a friendly message when the server returns a 500 error?

Asked byMicrosoftAdobeNetflixGoogle
Why interviewers ask this

Hands-on "how would you test that the UI shows a friendly message when the server returns a 500 error" 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: Force the error with a route, then assert on the message.

await page.route('**/api/profile', (route) => route.fulfill({ status: 500 }));
await page.goto('/profile');
await expect(page.getByText('Something went wrong. Please try again.')).toBeVisible();
Tips to remember
  • Walk through test that the UI shows a friendly message when the server returns a 500 error as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the test that the UI shows a friendly message when the server returns a 500 error 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 minQ14 / 25

Q14.Creating test data through the UI takes most of the test time. How do you speed it up?

Asked byStripeMicrosoftAdobeNetflix
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Creating test data through the UI takes most of the test time. How do you speed it up 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: Create data through the API using Playwright's built-in request fixture, then use the UI only for the behaviour being tested.

test('edit an existing order', async ({ page, request }) => {
  const res = await request.post('/api/orders', { data: { item: 'Notebook', qty: 2 } });
  expect(res.ok()).toBeTruthy();
  const { id } = await res.json();

  await page.goto('/orders/' + id);
  await page.getByRole('button', { name: 'Edit' }).click();
  // ...
});

We cover this pattern in depth in the Playwright API testing guide.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Creating test data through the UI takes most of the test time. How do you speed it up over textbook wording.
  • Be ready to whiteboard the Creating test data through the UI takes most of the test time. How do you speed it up 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.How do you check that clicking "Save" sends the right data to the backend?

Asked byNetflixGoogleAirbnbShopify
Why interviewers ask this

Hands-on "how would you check that clicking "Save" sends the right data to the backend" 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 request and inspect its body.

const requestPromise = page.waitForRequest('**/api/settings');
await page.getByRole('button', { name: 'Save' }).click();
const req = await requestPromise;
expect(req.method()).toBe('PUT');
expect(req.postDataJSON()).toMatchObject({ newsletter: true });
Tips to remember
  • Walk through check that clicking "Save" sends the right data to the backend as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the check that clicking "Save" sends the right data to the backend 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 Network Mocking and API Testing 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. Iframes, Tabs, Uploads and Downloads

Medium Common 1 minQ16 / 25

Q16.The card payment form is inside an iframe and your locator can't find the input. Why, and how do you fix it?

Asked byAdobeNetflixGoogleAirbnb
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on The card payment form is inside an iframe and your locator can't find the input. Why, and how do you fix it 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: A page locator doesn't look inside iframes. Use frameLocator to step into the frame first.

const card = page.frameLocator('iframe[title="Secure card payment"]');
await card.getByLabel('Card number').fill('4111 1111 1111 1111');
Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on The card payment form is inside an iframe and your locator can't find the input. Why, and how do you fix it over textbook wording.
  • Be ready to whiteboard the The card payment form is inside an iframe and your locator can't find the input. Why, and how do you fix it snippet live — panels often ask you to type it, not describe it.
  • Finish by saying you always return to the default content after frame work — forgetting that is the classic failure this question hunts for.
Medium Common 1 minQ17 / 25

Q17.Clicking "View invoice" opens a new tab. How do you test the content of that tab?

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Clicking "View invoice" opens a new tab. How do you test the content of that tab 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: Start waiting for the new page before the click, then work with it.

const popupPromise = page.context().waitForEvent('page');
await page.getByRole('link', { name: 'View invoice' }).click();
const invoice = await popupPromise;
await invoice.waitForLoadState();
await expect(invoice.getByRole('heading', { name: /Invoice/ })).toBeVisible();
Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Clicking "View invoice" opens a new tab. How do you test the content of that tab over textbook wording.
  • Be ready to whiteboard the Clicking "View invoice" opens a new tab. How do you test the content of that tab 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.
Medium Common 1 minQ18 / 25

Q18.How do you test uploading a resume and downloading a report?

Asked byGoogleAirbnbShopifyUber
Why interviewers ask this

Hands-on "how would you test uploading a resume and downloading a report" 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 setInputFiles for uploads and the download event for downloads.

await page.getByLabel('Upload resume').setInputFiles('fixtures/resume.pdf');
await expect(page.getByText('resume.pdf')).toBeVisible();

const downloadPromise = page.waitForEvent('download');
await page.getByRole('button', { name: 'Download report' }).click();
const download = await downloadPromise;
expect(download.suggestedFilename()).toMatch(/report.*\.csv$/);
Tips to remember
  • Walk through test uploading a resume and downloading a report as numbered steps and call out the tool, command, or API used at each step.
  • Be ready to whiteboard the test uploading a resume and downloading a report 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 minQ19 / 25

Q19.A "Delete account" button shows a browser confirm dialog. Your test hangs. Why?

Asked byUberStripeMicrosoftAdobe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on A "Delete account" button shows a browser confirm dialog. Your test hangs. 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: By default Playwright dismisses dialogs automatically, so the delete is cancelled and the test waits for something that never happens. Register a dialog handler before the click and accept it.

page.once('dialog', (dialog) => dialog.accept());
await page.getByRole('button', { name: 'Delete account' }).click();
Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on A "Delete account" button shows a browser confirm dialog. Your test hangs. Why over textbook wording.
  • Be ready to whiteboard the A "Delete account" button shows a browser confirm dialog. Your test hangs. Why 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 Iframes, Tabs, Uploads and Downloads 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. Framework Design, Parallel Runs and CI

Medium Occasional 1 minQ20 / 25

Q20.Tests pass alone but fail when run in parallel. What is the likely cause?

Asked byShopifyUberStripeMicrosoft
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Tests pass alone but fail when run in parallel. What is the likely cause 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: Shared state — usually the same user account or data record changed by two workers at once. I give each worker its own data, for example by creating a unique user per test or per worker in a fixture, and I make sure no test depends on another test's leftovers. testInfo.workerIndex or a unique id helps create separate data.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Tests pass alone but fail when run in parallel. What is the likely cause over textbook wording.
  • Be ready to whiteboard the Tests pass alone but fail when run in parallel. What is the likely cause 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 minQ21 / 25

Q21.Your suite of 600 tests takes 70 minutes in CI. How do you bring it down?

Asked byMicrosoftAdobeNetflixGoogle
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Your suite of 600 tests 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: In order: move data setup to API calls, reuse login with storageState, raise workers to match the CI machine, then split the run across machines with sharding.

npx playwright test --shard=1/4
npx playwright test --shard=2/4
# ...run each shard on a separate CI job, then merge reports
npx playwright merge-reports --reporter html ./all-blob-reports

I'd also tag a fast smoke set with @smoke and run it on every pull request, leaving the full suite for merges.

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

Q22.A test fails only in CI, never on your laptop. How do you debug it?

Asked byStripeMicrosoftAdobeNetflix
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on A test fails only in CI, never on your laptop. How do you debug it 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: Turn on traces, screenshots and video for failures, download the artifacts and open the trace with npx playwright show-trace trace.zip. The trace shows each action, the page snapshot, console logs and network calls. Common causes I check: a different viewport or timezone, headless rendering, slower CI machines, and missing environment variables.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on A test fails only in CI, never on your laptop. How do you debug it over textbook wording.
  • Be ready to whiteboard the A test fails only in CI, never on your laptop. How do you debug it 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 minQ23 / 25

Q23.Ten test files repeat the same login and page setup. How do you remove the duplication?

Asked byNetflixGoogleAirbnbShopify
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on Ten test files repeat the same login and page setup. How do you remove the duplication 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: Create custom fixtures with test.extend, combined with page objects, so each test asks for what it needs.

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

export const test = base.extend<{ dashboard: DashboardPage }>({
  dashboard: async ({ page }, use) => {
    const dashboard = new DashboardPage(page);
    await dashboard.goto();
    await use(dashboard);
  },
});

See the Playwright fixtures deep dive for more patterns.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on Ten test files repeat the same login and page setup. How do you remove the duplication over textbook wording.
  • Be ready to whiteboard the Ten test files repeat the same login and page setup. How do you remove the duplication 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 Occasional 1 minQ24 / 25

Q24.The product team wants the same tests on Chrome, Firefox, Safari and a mobile viewport. How?

Asked byAdobeNetflixGoogleAirbnb
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on The product team wants the same tests on Chrome, Firefox, Safari and a mobile viewport. How 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: Define projects in the config. Each project runs the full suite with its own browser or device settings.

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

export default defineConfig({
  projects: [
    { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
    { name: 'firefox', use: { ...devices['Desktop Firefox'] } },
    { name: 'webkit', use: { ...devices['Desktop Safari'] } },
    { name: 'mobile', use: { ...devices['Pixel 7'] } },
  ],
});
Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on The product team wants the same tests on Chrome, Firefox, Safari and a mobile viewport. How over textbook wording.
  • Be ready to whiteboard the The product team wants the same tests on Chrome, Firefox, Safari and a mobile viewport. How snippet live — panels often ask you to type it, not describe it.
  • Split the answer into emulator (fast feedback) vs real device (final gate) and say where each runs in your pipeline.
Medium Occasional 1 minQ25 / 25

Q25.A visual layout bug reached production even though all tests passed. What would you add?

Asked byAirbnbShopifyUberStripe
Why interviewers ask this

This Playwright question checks whether you can go beyond textbook knowledge on A visual layout bug reached production even though all tests passed. What would you add 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: Functional assertions don't check layout. I'd add screenshot comparisons on a few key pages with await expect(page).toHaveScreenshot(), masking changing content such as dates, and run them on one fixed browser and OS so the baseline images stay stable. Our visual regression testing guide covers the setup.

Tips to remember
  • Anchor the answer in a real Playwright project — panels reward specificity on A visual layout bug reached production even though all tests passed. What would you add over textbook wording.
  • Be ready to whiteboard the A visual layout bug reached production even though all tests passed. What would you add 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.
RelatedQ23
Confidence check

If you can confidently answer the Framework Design, Parallel Runs and CI 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: A test passes locally but fails about 1 in 10 runs in CI with "element not visible". What do you do — Answer: First I open the trace for a failing run to see what the page looked like at the moment of failure.
  2. Q2: A teammate added page.waitForTimeout(5000) to fix a flaky test. How do you respond — Answer: A fixed wait either wastes time on fast runs or still fails on slow ones.
  3. Q3: A click sometimes does nothing because an overlay covers the button for a moment. How do you handle it — Answer: Playwright's actionability checks already wait for the element to be visible, stable, enabled and to receive events.
  4. Q4: Your suite has retries: 3 and most failures pass on retry. Is that acceptable — Answer: Retries keep the pipeline moving but hide problems.
  5. Q5: Developers keep changing CSS classes and your tests break every sprint. What do you change — Answer: I move to user-facing locators that follow what the user sees, in this order: getByRole , getByLabel , getByText , then getByTestId for elements with no accessible name.

Frequently asked questions

1.What are scenario-based Playwright interview questions?
They describe a real testing problem, such as a flaky test or a slow login, and ask how you would solve it with Playwright. They test practical judgement rather than definitions.
2.How should I structure my answer to a Playwright scenario question?
Clarify the situation with one or two questions, name the likely cause, show the Playwright fix (ideally with a short code example), then explain how you would prevent the problem from returning.
3.Which Playwright topics come up most in scenario questions?
Flaky tests and auto-waiting, locator strategy, reusing login with storageState, network mocking with page.route(), iframes and new tabs, parallel execution, sharding and debugging CI failures with the trace viewer.
4.Should I use waitForTimeout in my interview answers?
No. Explain what the test should wait for instead, such as a web-first assertion, a network response or an element becoming hidden. Fixed waits are a common red flag for interviewers.
5.Do I need TypeScript for Playwright interviews?
Most Playwright roles use TypeScript or JavaScript, so examples in TypeScript are the safest choice. Playwright also supports Python, Java and .NET, so use the language named in the job description.
6.How many scenario questions are asked in a Playwright interview?
It varies by company. Mid-level automation roles often include a few scenario questions per technical round, while senior SDET rounds can be built almost entirely around scenarios and framework design.

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: Auto-waiting— playwright.dev
  2. 2
    Playwright: Authentication— playwright.dev
  3. 3
    Playwright: Mock APIs— playwright.dev
  4. 4
    Playwright: Trace viewer— playwright.dev
  5. 5

Discussion

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