All 49 questions
What are the advantages of Playwright over Selenium?
Asked in 10 of 145 interviews · last asked Nov 18 · Concept · Mid-level
Show answer
Playwright offers built-in automatic waits, retrying assertions, network mocking, and detailed test traces. These features reduce setup and help prevent timing-related failures. Its lightweight browser contexts make isolated tests easier and can speed up execution. Selenium supports more languages and browser configurations, so Playwright is not always the better choice.
- Playwright waits for elements to be ready before actions; Selenium usually needs more explicit wait handling.
- Browser contexts isolate cookies and storage without starting a new browser for every test.
- Network mocking and traces help test failures and debug problems without extra tools.
- Playwright supports Chromium, Firefox, and WebKit; WebKit testing is not the same as testing real Safari.
What the interviewer checks: The interviewer checks whether you understand Playwright’s practical benefits without claiming it is always faster or better.
Other ways it was asked
- “What are the advantages of Playwright compared with Selenium or Cypress?”
- “Why might Playwright be more convenient and faster than Selenium?”
- “What is the difference between Selenium and Playwright?”
What are workers used for in Playwright?
Asked in 4 of 145 interviews · last asked Oct 29 · Concept · Mid-level
Show answer
Workers in Playwright Test are separate processes that run tests in parallel to reduce total test time. Each worker runs its own browser instance. You can set the worker count to control how many run at once.
- Test files run in parallel by default; tests within one file run sequentially unless configured otherwise.
- Workers do not share in-memory variables.
- Each test gets a fresh browser context by default, even when tests share a worker.
- Too many workers can overload your machine or the application under test.
What the interviewer checks: The interviewer is checking whether you understand parallel test execution, test isolation, and resource limits.
Other ways it was asked
- “What are Playwright workers?”
- “What is Playwright used for?”
- “Tell me about Playwright and how you are using it.”
What is a browser context in Playwright?
Asked in 3 of 145 interviews · last asked Nov 18 · Concept · Mid-level
Show answer
A browser context in Playwright is an isolated browser session with its own cookies and storage. It lets tests run without sharing login state or other session data. A page is one tab or popup inside a context, and one context can contain several pages.
- Different contexts keep cookies and local storage separate.
- Pages in the same context share cookies and local storage for the same origin.
- Contexts are lightweight; you do not need a separate browser instance for each session.
What the interviewer checks: The interviewer is checking whether you understand test isolation and the difference between a browser, a context, and a page.
Other ways it was asked
- “What is browser context in Playwright, and what does it do?”
- “What is the difference between a browser context and a page in Playwright?”
How do you debug Playwright tests and handle asynchronous test execution?
Asked in 3 of 145 interviews · last asked Jul 22 · Tooling · Mid-level
Show answer
I debug Playwright tests with the Inspector, breakpoints, and Trace Viewer to inspect actions, errors, and page state. In JavaScript and TypeScript, I await browser actions and web assertions so steps finish in order. I use Playwright’s automatic waiting instead of fixed delays, and keep parallel tests independent.
- Run with --debug to open the Inspector; record traces to investigate failures after execution.
- Await promise-returning calls, including actions and retrying assertions; synchronous code does not need await.
- Playwright Test runs files in parallel workers by default; tests within each file run sequentially.
- Use fullyParallel for parallel tests within files; avoid shared accounts or data that tests could change.
What the interviewer checks: The interviewer checks whether you can investigate failures, handle asynchronous steps correctly, and run tests safely in parallel.
Other ways it was asked
- “How do you work with synchronous and asynchronous code in Playwright tests?”
- “How do you run tests in parallel in Playwright?”
What is the difference between a selector and a locator in Playwright?
Asked in 2 of 145 interviews · last asked Sep 8 · Concept · Mid-level
Show answer
A selector is a string that describes how to find an element, such as a CSS selector. A locator is a Playwright object used to find elements and interact with them. It finds the element again before each action and supports auto-waiting and retrying assertions.
- Create locators with page.locator(selector) or helpers like page.getByRole().
- A locator is not a saved DOM element; it resolves against the current page.
- Actions such as click fail if the locator matches multiple elements.
JavaScriptconst selector = '#submit'; const locator = page.locator(selector); await locator.click();What the interviewer checks: The interviewer checks whether you understand how locators add reliable interaction beyond an element-matching string.
How do you upload a file in a Playwright test?
Asked in 2 of 145 interviews · last asked Jun 22 · Write code · Junior
Show answer
I use locator.setInputFiles() to attach a file to the form's file input. Then I submit the form and check that the upload succeeded. If a button opens a file chooser, I start waiting for the filechooser event before clicking, then call chooser.setFiles().
- Relative file paths start from the current working directory, not the test file's folder.
- Pass an array of paths when the input supports multiple files.
- Check the upload result, not just the selected filename.
- Playwright sets files without controlling the operating system's file picker.
JavaScript// tests/upload.spec.js; run: npx playwright test tests/upload.spec.js // Assumes this local form exists and tests/fixtures/photo.png is available. import { test, expect } from '@playwright/test'; test('uploads an image', async ({ page }) => { await page.goto('http://localhost:3000/upload'); await page.locator('input[type="file"]').setInputFiles('tests/fixtures/photo.png'); await page.getByRole('button', { name: 'Upload', exact: true }).click(); await expect(page.getByText('Upload complete', { exact: true })).toBeVisible(); });What the interviewer checks: The interviewer checks whether you can select files reliably and verify that the application uploaded them.
Other ways it was asked
- “How would you write and run a Playwright test that uploads an image through a form?”
- “How do you upload files in Playwright tests?”
How do you prepare or manipulate test data in Playwright before making an assertion?
Asked in 2 of 145 interviews · last asked Nov 18 · Tooling · Mid-level
Other ways it was asked
- “How do you maintain and manage test data in Playwright?”
How would you write a Playwright test for a login flow and verify successful login?
Asked in 2 of 145 interviews · last asked Oct 29 · Write code · Mid-level
Other ways it was asked
- “How would you write a JavaScript Playwright test for a login flow?”
- “How would you use Playwright to validate a successful login?”
- “How would you use Playwright to automate a login page?”
How does getByRole work in Playwright?
Asked once · last asked Aug 4 · Concept · Mid-level
Other ways it was asked
- “Do you know how getByRole works in Playwright internally?”
When do you need to import `test` and `expect` in a Playwright test file?
Asked once · last asked Sep 11 · Concept · Junior
How would you use Playwright to click a button?
Asked once · last asked Jan 27 · Write code · Junior
Why might you avoid XPath selectors in Playwright?
Asked once · last asked Jan 27 · Concept · Mid-level
How does Playwright handle waits?
Asked once · last asked Jan 27 · Concept · Mid-level
How do you handle dynamic elements in the UI with Playwright?
Asked once · last asked Jan 27 · Tooling · Mid-level
How would you configure Playwright to test multiple environments and browsers and handle feature flags?
Asked once · last asked Apr 27 · Tooling · Senior
What is the difference between fixtures and projects in Playwright, and what would you use each for?
Asked once · last asked Apr 27 · Concept · Mid-level
How would you create and use custom extensions or plugins for Playwright?
Asked once · last asked Apr 27 · Tooling · Senior
What are user-facing attributes in Playwright, and how would you describe them?
Asked once · last asked May 28 · Concept · Mid-level
In a Playwright test, what happens if you omit `await` from an asynchronous action? Will the test still run or produce an error?
Asked once · last asked Jun 22 · Concept · Junior
In a Playwright image-upload test, how do you select the image file and specify its file path?
Asked once · last asked Jun 22 · Tooling · Junior
Which locator types do you prefer in Playwright, and why?
Asked once · last asked Jul 22 · Tooling · Mid-level
How would you implement a custom getByRole locator using element attributes in Playwright?
Asked once · last asked Aug 4 · Write code · Senior
Other ways it was asked
- “How would you implement a custom getByRole locator in Playwright?”
- “How would you implement a custom getByRole locator using element attributes?”
How do you run only the failed test cases in Playwright?
Asked once · last asked Aug 31 · Tooling · Mid-level
When would you build custom wrappers or helpers around Playwright's built-in mechanisms, and when would you use its native API and auto-waiting directly?
Asked once · last asked Sep 8 · Concept · Senior
Is Playwright's console logging sufficient, and how do you handle logging in a Playwright test framework?
Asked once · last asked Sep 8 · Tooling · Mid-level
What are Playwright fixtures, and when would you create custom fixtures?
Asked once · last asked Sep 8 · Concept · Mid-level
Why might a team migrate from ReadyAPI to Playwright, and how would you plan the migration?
Asked once · last asked Sep 8 · Scenario · Senior
What is the difference between the test timeout and the action timeout in Playwright configuration?
Asked once · last asked Sep 8 · Concept · Mid-level
Other ways it was asked
- “What is the difference between a timeout and an action timeout in Playwright?”
Why are Playwright test functions asynchronous, and what does `async` mean in a test?
Asked once · last asked Sep 11 · Concept · Mid-level
How would you implement test automation with Playwright, and what would your tests cover?
Asked once · last asked Sep 21 · Tooling · Mid-level
Other ways it was asked
- “When using Playwright for test automation, what did you personally implement, and what did your tests cover?”
How would you use Playwright to test whether content overflows its container?
Asked once · last asked Oct 2 · Tooling · Mid-level
How can you locate elements in Playwright when the page has no good selectors or class names?
Asked once · last asked Oct 8 · Scenario · Mid-level
How can you prevent timeouts in Playwright tests?
Asked once · last asked Oct 8 · Scenario · Mid-level
What is Playwright's storage state, and how is it used?
Asked once · last asked Oct 8 · Concept · Mid-level
How would you write an asynchronous Playwright method to enter a starting amount, an ending amount, and a currency?
Asked once · last asked Oct 8 · Write code · Mid-level
How would you audit an existing Playwright automation suite and propose a plan of action to the client?
Asked once · last asked Oct 22 · Scenario · Senior
How do you capture and manage screenshots, videos, and test reports in Playwright, including where to store them and how long to retain them?
Asked once · last asked Oct 26 · Tooling · Mid-level
Where would you store an authentication token in a Playwright test?
Asked once · last asked Oct 29 · Tooling · Mid-level
What is the difference between Playwright and TestNG?
Asked once · last asked Nov 1 · Concept · Junior
What locator strategies does Playwright provide?
Asked once · last asked Nov 14 · Concept · Junior
Write TypeScript code to handle multiple browser windows in an automated test.
Asked once · last asked Nov 14 · Write code · Mid-level
Other ways it was asked
- “Write TypeScript code for handling multiple windows.”
How would you write an XPath locator for an element in Playwright?
Asked once · last asked Nov 14 · Tooling · Mid-level
What are Playwright fixtures, and how do they compare with beforeEach hooks?
Asked once · last asked Nov 18 · Concept · Mid-level
How do you validate that actual results match expected results in Playwright?
Asked once · last asked Nov 18 · Tooling · Mid-level
Other ways it was asked
- “How did you validate in Playwright whether the expected and actual results matched?”
What Playwright code would you write to compare expected and actual results?
Asked once · last asked Nov 18 · Write code · Mid-level
What does the `page` object represent in Playwright?
Asked once · last asked Sep 11 · Concept · Junior
Which Playwright method would you use to fill an input field?
Asked once · last asked Oct 8 · Tooling · Junior
What do you understand by Playwright?
Asked once · last asked Oct 10 · Concept · Junior
How do you locate an element by its ID in Playwright?
Asked once · last asked Oct 29 · Tooling · Junior
More Automation Testing interview questions
- All Automation Testing interview questions
- Automation Testing Basics and Strategy Interview Questions
- Test Automation Framework Design Interview Questions
- Selenium, Cypress and Mobile Automation Interview Questions
- API and End-to-end Automation Testing Interview Questions
How this list is made
Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.
Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.
The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every Automation Testing interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.
145 interviews, 79 candidates, Jan 2026 to Nov 2026. Updated every month with new interviews.
Or add the Chrome extension