Skip to content
Live on Product Hunt

We just launched BrainUp on Product Hunt. Thanks for coming over!

BrainUp
  • Templates
  • Resume Guides
  • Blog
  • Pricing
  • Contact
Log inBuild Resume
  • Templates
  • Resume Guides
  • Blog
  • Pricing
  • Contact
  • Log in
Build My Resume — Free
BrainUp

Build your resume. Then build your advantage. The career productivity toolkit for your whole job search.

Products

  • Free Resume Builder
  • Cover Letter Builder
  • LinkedIn Optimizer (Premium)
  • AI Interview Prep (Premium)
  • Job Tracker (Premium)

Resources

  • Resume Templates
  • Resume Guides
  • Career Blog

Company

  • Pricing
  • Contact us

Legal

  • Terms
  • Privacy
  • Cookies

© 2026 BrainUp. All rights reserved. ·

BrainUp is a career productivity tool, not a recruitment agency. We help you prepare — we don't guarantee interviews, job offers or ATS outcomes.

BrainUp

  1. Home
  2. Playwright Interview Questions

Playwright interview prep

Playwright Interview Questions: Reliable Tests, Not Flaky Ones

Playwright interviews focus on resilient locators, auto-waiting and web-first assertions, fixtures and the Page Object Model, parallel execution, API testing, and how you debug and stop flaky tests in CI.

Practise with AI Interview PrepSee automation testing resume
  • 15 questions answered
  • TypeScript examples
  • Flaky-test fixes
  • CI-ready

Sample answers

Show you've stabilised a real suite.

Interviewers care less about syntax and more about how you keep tests fast and reliable.

Model answers for 4 Playwright questions

Typical round: concepts, framework design, live test writing

Q: How is Playwright different from Selenium? A: Playwright talks to browsers directly instead of through WebDriver, auto-waits for elements to be actionable, supports Chromium, Firefox and WebKit from one API, and ships with a test runner, tracing and parallelism built in.

Q: Which locators do you prefer and why? A: User-facing ones: getByRole, getByLabel, getByText and getByTestId. They survive styling and layout changes better than CSS or XPath chains, and they encourage accessible markup.

Q: How do you fix a flaky test? A: Open the trace to see what happened, replace fixed waits with web-first assertions like expect(locator).toBeVisible(), isolate test data so tests don't share state, and mock unstable third-party calls. Retries are a safety net, not the fix.

Q: How do you handle login across many tests? A: Log in once in a setup project, save storageState to a file, and reuse it in other projects so tests start already authenticated.

What interviewers check

Built for scanners, humans and hiring intent.

  • Resilient locators

    Role- and label-based locators instead of brittle XPath show you write maintainable tests.

  • Flaky test discipline

    Traces, web-first assertions and isolated test data are what senior QA engineers talk about.

  • Framework structure

    Fixtures, Page Object Model, config projects and environment handling for a real suite.

  • Speed in CI

    Parallel workers, sharding and reporting keep feedback under a few minutes.

Examples

Copy the structure, not the wording.

These examples show shape and specificity. Add your own facts, metrics, tools and outcomes.

Core concepts

  • What is auto-waiting?
  • What are web-first assertions?
  • What is a browser context?
  • What is the trace viewer?
  • Which languages does Playwright support?

Framework design

  • How do you structure page objects?
  • What are fixtures and why use them?
  • How do you run tests across browsers?
  • How do you manage test data?
  • How do you shard tests in CI?

Hands-on tasks

  • Write a login test with storageState reuse.
  • Intercept and mock an API response.
  • Upload a file and assert the result.
  • Test a new tab or popup.
  • Write an API test with the request fixture.

Actionable tips

Small edits that lift response rates.

Run through these before every application.

  1. 1Prefer getByRoleSay why user-facing locators beat XPath. It's one of the most common Playwright follow-ups.
  2. 2Never use fixed waitsIf you mention waitForTimeout, explain it's only for debugging. Use assertions that auto-wait.
  3. 3Bring a flaky-test storyExplain one flaky test, what the trace showed and how you fixed the root cause.
  4. 4Know the config fileProjects, retries, workers, baseURL and reporters in playwright.config are often asked about.
  5. 5Rehearse explanationsBrainUp AI Interview Prep runs QA mock interviews and gives feedback on your answers.

FAQ

Common questions, direct answers.

What is Playwright?

Playwright is an open-source end-to-end testing framework from Microsoft that automates Chromium, Firefox and WebKit with one API, and includes a test runner, assertions and tracing.

What is the difference between Playwright and Selenium?

Playwright uses direct browser protocols, auto-waits for elements, has built-in parallelism, tracing and a test runner. Selenium uses WebDriver and has broader legacy language and grid support.

What is auto-waiting in Playwright?

Before actions like click or fill, Playwright waits until the element is attached, visible, stable, enabled and able to receive events, reducing the need for manual waits.

What are web-first assertions?

Assertions like expect(locator).toHaveText() that automatically retry until the condition is met or a timeout is reached.

Which locators are recommended in Playwright?

getByRole, getByLabel, getByPlaceholder, getByText and getByTestId, because they reflect how users see the page and resist layout changes.

What is a browser context?

An isolated, incognito-like browser session with its own cookies and storage. Each test gets a fresh context, so tests don't leak state.

What are fixtures in Playwright Test?

Fixtures provide setup and teardown for tests, such as page, context or a logged-in user, and can be extended with your own custom fixtures.

How do you implement the Page Object Model in Playwright?

Create a class per page with locators and actions, pass the page into its constructor, and use those methods in tests. Fixtures can inject page objects automatically.

How do you run tests in parallel?

Playwright runs test files in parallel across workers by default; set the workers count in config and use fullyParallel or sharding for CI.

How do you handle authentication in Playwright?

Log in once in a setup project, save storageState to a file, and reuse it in dependent projects so tests skip the login UI.

How do you mock network requests?

Use page.route to intercept matching URLs and fulfil them with mock data, or abort them, to test UI states without relying on real backends.

Can Playwright do API testing?

Yes. The request fixture sends HTTP requests, which is useful for API tests and for preparing test data before UI steps.

How do you debug a failing Playwright test?

Use the trace viewer, run in headed or UI mode, use the inspector with page.pause(), and review screenshots and videos captured on failure.

How do you reduce flaky tests?

Use stable locators and web-first assertions, avoid fixed waits, isolate test data, mock unstable dependencies, and investigate traces instead of only adding retries.

How should I prepare for a Playwright interview?

Build a small suite with page objects, fixtures, API mocking and CI, fix at least one flaky test using traces, and be ready to write a test live.

Related guides

Keep improving your application.

  • Automation Testing ResumePresent your Playwright framework and results.View automation resume →
  • Software Testing ResumeBroader QA resume covering manual and automation.View testing resume →
  • Manual Testing Interview QuestionsQA fundamentals asked alongside automation.See manual testing questions →

Practise QA automation interview answers

BrainUp AI Interview Prep runs testing-role mock interviews with feedback.

Start interview practiceBrowse templates

The resume builder and PDF downloads are free. AI tools are part of BrainUp Premium.