Playwright JavaScript Interview Playbook

Not 300 questions. The 48 Playwright questions SDET interviews keep coming back to.

Answer the 48 Playwright questions SDET interviews keep coming back to, with JavaScript code you can explain.

Not 300 questions. The 48 Playwright questions SDET interviews keep coming back to, with clear answers, JavaScript code and the mistakes to avoid.

  • 47 pages
  • 12 parts
  • 48 questions
  1. Buy
  2. Instant download
  3. Prepare part by part

Knowing Playwright and explaining it are two different skills

In interviews, good testers lose marks because:

  • They describe what a feature is, not the problem it solves in a real project.
  • Scenario questions (two users side by side, a flaky test, a 3 second token setup) catch them without a ready example.
  • Their code works on their machine but they cannot explain why, for example why a fixture beats beforeEach.
  • They repeat the same weak answer interviewers hear all day.

Why 48 and not 300

Question banks with hundreds of entries spread your time thin and repeat the same idea in ten forms. These 48 are the questions SDET interviews keep returning to, each answered properly with code. You prepare what you are most likely to be asked, and you prepare it well.

After this playbook you can

  • Answer every common Playwright question in short points you can say out loud.
  • Back each answer with a small, real JavaScript example.
  • Handle scenario questions on contexts, locators, auto-waiting, fixtures, network mocking, auth, flaky tests and CI.
  • Avoid the common mistake listed under every answer.
  • Prove it with a hands-on task at the end of every part.

Look inside

The first 3 pages of 47, exactly as you get them. Swipe, then tap a page to enlarge it.

  • Preview page 4 of 47, locked
  • Preview page 5 of 47, locked
  • Preview page 6 of 47, locked

Buy to unlock all 47 pages

Full table of contents

All 12 parts and 48 questions, exactly as they appear in the PDF. Tap a part to see its questions.

Part 1. Playwright Basics and Architecture4 questions
  1. Your QA lead asks why the team should spend a sprint adopting Playwright. What problems does it remove for testers?
  2. A banking test needs a maker and a checker logged in side by side, without sharing cookies. Which Playwright objects do you use, and why?
  3. Which browsers can Playwright run, and what does device emulation really cover?
  4. You join a team with no automation at all. Walk me through your first hour setting up Playwright in JavaScript.
Part 2. JavaScript for Testers5 questions
  1. When would you choose JavaScript over TypeScript for a Playwright suite?
  2. Explain Promises and async/await in the context of Playwright tests.
  3. A teammate's test fails with "Cannot use import statement outside a module". What is going on, and how do you fix it?
  4. How do you get type safety in a JavaScript Playwright project without moving to TypeScript?
  5. The same suite must run against QA, staging and pre-prod, and a password was just found in Git. How do you set up config properly?
Part 3. Locators5 questions
  1. What makes a Playwright Locator different from finding an element once?
  2. In what order do you pick locators, and why?
  3. How do you pick one item from a list or table reliably?
  4. An embedded support chat widget loads in an iframe and its buttons are web components. How do you click inside it?
  5. Which tools help you find good locators fast?
Part 4. Auto-waiting and Assertions5 questions
  1. What does Playwright wait for before it clicks or types?
  2. Why should you use web-first assertions instead of reading values first?
  3. When do you use expect.soft, expect.poll and toPass?
  4. A report page legitimately needs 50 seconds to load. Which timeout do you change, and which ones do you leave alone?
  5. How do you build stable visual tests with screenshots?
Part 5. Test Runner, Config and Projects4 questions
  1. Explain the key settings you keep in playwright.config.js.
  2. What are projects, and how do dependencies between projects work?
  3. How do you group, tag and filter tests, and how do you make reports readable?
  4. How do you handle tests that must run one after another?
Part 6. Fixtures and Hooks3 questions
  1. What is a fixture, and how do you create a custom one in JavaScript?
  2. Creating an API token takes 3 seconds and every test creates one. How can fixture scope cut that cost?
  3. How are hooks different from fixtures, and what is the catch with beforeAll?
Part 7. Page Object Model and Framework Design3 questions
  1. A designer renames the Login button and 40 tests break. How would a page object have limited the damage?
  2. Your suite grew from 20 to 400 tests and nobody can find anything. How would you reorganise the framework?
  3. What is your approach to test data in Playwright?
Part 8. Network Mocking and API Testing5 questions
  1. The product list API is down in the test environment, but you still need to test the empty and error screens. What do you do?
  2. Clicking Save triggers a PUT request, and the toast appears before the data is stored. How do you wait for the real API call?
  3. Your team wants API checks in the same repo and runner as the UI tests. Show how you test a REST endpoint with Playwright.
  4. How do you mix API calls and UI checks in one test?
  5. What are HAR files, and how can they make UI tests independent of a backend?
Part 9. Authentication and Sessions3 questions
  1. Your login page has a slow SSO redirect that adds 8 seconds to each test. How do you skip it safely?
  2. How do you test features that need different user roles?
  3. How do you deal with OTP, 2FA and captcha in automation?
Part 10. Debugging and Flaky Tests4 questions
  1. Walk me through how you debug a failed Playwright test.
  2. A developer says your failed test is "just flaky". How do you use a trace to prove what really happened?
  3. The search test passes every time on your machine but fails in the Jenkins job. What is your checklist?
  4. What usually causes flaky Playwright tests, and how do you fix each cause?
Part 11. Parallel Runs, CI/CD and Docker4 questions
  1. Your nightly run takes 50 minutes on one worker. What changes when you add workers, and what can break?
  2. How do you split a large suite across machines and get one report?
  3. What does a Playwright CI pipeline look like?
  4. A new joiner's tests fail on their Windows laptop but pass on yours. How would a container setup end this problem?
Part 12. Playwright with AI3 questions
  1. What is Playwright MCP, and how can it help a tester?
  2. How do you use AI tools in automation work responsibly?
  3. What are Playwright test agents?

A real answer from the playbook

What is a fixture, and how do you create a custom one in JavaScript?

  • A fixture prepares something for a test and cleans it up afterwards.
  • Built-in fixtures include page, context, browser and request.
  • Tests receive fixtures by naming them in the function arguments.
  • Create your own with test.extend and export the extended test.
exports.test = base.test.extend({
  cartPage: async ({ page }, use) => {
    const cartPage = new CartPage(page);
    await cartPage.open();
    await use(cartPage); // the test runs here
    await cartPage.clear(); // teardown
  },
});

Remember: Fixtures run only when a test asks for them.

Who it is for

This is for you if

  • Testers interviewing for Playwright roles where the team writes tests in JavaScript.
  • Selenium testers moving to Playwright who need to sound experienced, fast.
  • Anyone who learnt Playwright from tutorials and now needs interview-ready answers.

It is not for you if

  • Your team uses TypeScript. Get the Playwright TypeScript Interview Playbook, it is free.
  • You have never written a test. Start with the free Playwright lessons on the LMS first.
  • You want a video course. This is a reading and practice playbook.

What is inside

  1. In every answerShort points to say out loud, a small real code example, the one line to remember and the common mistake to avoid.
  2. Try it yourselfA hands-on task at the end of every part.

PDF, 47 pages. Works on phone and laptop.

From Jatin

Jatin Shharma

12+ years in test automation at Infosys, HERE Maps (originally Nokia Maps) and B2X. Client work for BMW and Audi, including self-parking car automation.

More about Jatin

Questions

Why only 48 questions?

Long question banks spread your time thin. These are the 48 questions SDET interviews keep coming back to, each answered properly, so you prepare what you are most likely to be asked instead of skimming hundreds.

Who is it for?

Testers interviewing for Playwright roles where the team writes tests in JavaScript.

Is there a TypeScript version?

Yes, the Playwright TypeScript Interview Playbook, free in the shop.

What format is it?

A PDF you can read on your phone or laptop and print if you like. The download link comes to your email and stays in My purchases.

Do I get updates?

Yes. Everyone who has it gets every update, and fresh links always download the newest version.

Is this generic content I can find online?

No. Every answer is written for the way SDET interviews are run: the points to say, the code to show, and the mistake that loses marks.

Sound like you have done it, because you will have

48 questions, 12 parts, code in every answer and a task at the end of every part.

Price: β‚Ή499
$9 if you pay by card from outside India

Also in a bundle