- Jul 23, 2026
- admin
- 0

If you’re preparing for a Playwright Automation Tester interview (3–10 years experience), these are some of the most commonly asked questions.
Basic Questions
- What is Playwright?
- Why do you prefer Playwright over Selenium?
- Which browsers does Playwright support?
- What are the advantages of Playwright?
- What are Browser, BrowserContext, and Page?
- Can one Browser have multiple BrowserContexts?
- What is the difference between BrowserContext and Page?
- How do you launch a browser in headless and headed mode?
- How do you close the browser properly?
Locator Questions
- What types of locators are available in Playwright?
- Which locator should you prefer and why?
- Difference between:
- locator()
- getByRole()
- getByText()
- getByLabel()
- getByTestId()
- What happens if multiple elements match a locator?
- What is strict mode?
- What is locator chaining?
- What is .filter()?
- Difference between CSS and XPath in Playwright.
- Why should XPath be avoided when possible?
Auto Waiting
- What is Auto Waiting?
- Which actions automatically wait?
- Why is Thread.sleep() a bad practice?
- Difference between:
- waitForSelector()
- waitForLoadState()
- waitForURL()
- What is the default timeout?
- How do you change timeout globally?
- How do you change timeout for one action?
Browser Context
- Why use BrowserContext?
- How do you create multiple BrowserContexts?
- Can two contexts share cookies?
- Can two pages inside one context share session?
- Difference between incognito and normal browser.
- How do you clear cookies?
- How do you save authentication state?
- What is storageState()?
Authentication
- How do you avoid logging in before every test?
- Explain storageState.
- What is global setup?
- Where should authentication be performed?
- How do you reuse login across projects?
Assertions
- Difference between:
- expect(locator).toBeVisible()
- expect(locator).toHaveText()
- Difference between soft and hard assertions.
- What are auto-retrying assertions?
- How do assertions work internally?
Frames
- How do you handle iframe?
- Difference between:
- frameLocator()
- page.frame()
- Nested iframe handling.
- How do you switch back from iframe?
Multiple Tabs
- How do you handle new tabs?
- Difference between popup and new page.
- How do you wait for popup?
- How do you switch between tabs?
File Upload & Download
- How do you upload a file?
- Upload hidden input.
- Download a file.
- Verify downloaded file.
- Change download directory.
Alerts
- How do you handle alerts?
- Difference between alert, confirm, prompt.
- How do you capture alert text?
Network
- What is Network Interception?
- Difference between Mocking and Blocking.
- How do you mock an API?
- How do you modify API response?
- How do you capture request payload?
- How do you capture response?
- Verify status code.
- How do you simulate network failure?
API Testing
- What is APIRequestContext?
- GET request.
- POST request.
- Authentication.
- Verify JSON response.
- Read headers.
- Upload files through API.
- Chain API and UI tests.
Parallel Execution
- How does Playwright execute tests in parallel?
- What are Workers?
- Difference between parallel and serial mode.
- What is workerIndex?
- How do you disable parallel execution?
Projects
- What are Projects?
- Execute same test in Chrome, Firefox and Safari.
- Device emulation.
- Mobile testing.
Fixtures
- What are fixtures?
- Built-in fixtures.
- Custom fixtures.
- Difference between beforeEach and fixtures.
- Worker fixture vs Test fixture.
Hooks
- Difference between:
- beforeAll
- beforeEach
- afterEach
- afterAll
- When should beforeAll be avoided?
- Can hooks run in parallel?
POM (Page Object Model)
- Explain Page Object Model.
- Advantages.
- How do you organize large projects?
- Where should locators be stored?
- Should assertions be inside page classes?
Data Driven Testing
- Read JSON.
- Read Excel.
- Read CSV.
- Parameterized tests.
- Dynamic test generation.
Configuration
- Explain playwright.config.ts.
- baseURL.
- retries.
- workers.
- reporter.
- trace.
- screenshot.
- video.
- timeout.
- expect timeout.
Reporting
- HTML Reporter.
- Allure Reporter.
- JUnit Reporter.
- JSON Reporter.
- Custom Reporter.
CI/CD
- Execute Playwright in Jenkins.
- Execute in Azure DevOps.
- Execute in GitHub Actions.
- Headless execution.
- Docker support.
Debugging
- PWDEBUG.
- Inspector.
- Trace Viewer.
- Code Generator.
- Screenshots.
- Videos.
- Console logs.
Advanced Questions
- Explain Playwright architecture.
- Why is Playwright faster than Selenium?
- What is auto-waiting internally?
- Difference between Locator and ElementHandle.
- Why is ElementHandle discouraged?
- Difference between Playwright Test and Jest.
- How does Playwright communicate with browsers?
- How is synchronization handled?
- What is actionability check?
- What is strict mode?
- Difference between locator.click() and page.click().
- Why should locator() be preferred?
- Difference between expect.poll() and expect().
- How do you test microservices using Playwright?
- How do you execute UI and API tests together?
Scenario-Based Questions (Frequently Asked)
- How would you automate an OTP-based login?
- How would you automate CAPTCHA-protected pages?
- How would you handle flaky tests?
- A test passes locally but fails in CI. How would you debug it?
- How do you test an application across multiple user roles simultaneously?
- How would you verify a downloaded PDF?
- How would you validate an email received after user registration?
- How do you automate drag-and-drop functionality?
- How would you test file uploads larger than 100 MB?
- How do you handle dynamic tables and pagination?
- How do you test applications with frequent UI changes?
- How would you optimize a Playwright suite with 5,000+ test cases?
- How do you run only failed tests?
- How do you implement retries without masking real defects?
- How would you integrate Playwright tests into a CI/CD pipeline with parallel execution and reporting?
For senior (6+ years) Playwright roles, interviewers often focus less on syntax and more on framework design, debugging strategies, scalability, CI/CD integration, test architecture, and handling real-world automation challenges. Mastering these areas will significantly improve your performance in technical interviews.
For more Playwright tutorials, examples, and automation concepts, visit our Playwright Tutorial section.

