← All Playwright mock interview topics
Test your knowledge of Locators and Interactions with a timed Playwright MCQ mock test. Each attempt gives you 20 random questions in 20 minutes from a 200-question bank covering getBy* locators, strictness, filtering and chaining, CSS and XPath selectors, actions and actionability, keyboard and mouse input, file uploads, codegen, dialogs, popups and tabs, iframes, web tables and downloads. Submit to see your score, the correct answers and an explanation for every question.
What this mock test covers
The questions follow Module 4 of the free Playwright with TypeScript tutorial. Revise these lessons if a question catches you out:
- Playwright locators with TypeScript
- CSS and XPath selectors in Playwright
- Playwright actions: click, fill, select and more
- Playwright codegen: record tests
- Handle alerts, popups, iframes and tabs
- Read data from web tables
- File downloads in Playwright
Sample questions with answers
- Q. Which locator does Playwright recommend first for interactive elements?
Answer: page.getByRole()
Role locators reflect how users and assistive technologies perceive the page, so they are the most resilient choice. - Q. Which locator finds an input by its associated `<label>` text?
Answer: getByLabel
`getByLabel('Email')` finds form controls by label, aria-labelledby or aria-label. - Q. Which locator finds an input by its placeholder text?
Answer: getByPlaceholder
`getByPlaceholder('Search')` matches the placeholder attribute. - Q. Which locator finds an image by its alt text?
Answer: getByAltText
`getByAltText('Company logo')` matches the alt attribute of images and areas. - Q. Which locator matches an element by its `title` attribute?
Answer: getByTitle
`getByTitle('Close')` matches the title attribute.
Ready for more? Go back to the Playwright mock interview dashboard to track your overall interview readiness across all topics.
Frequently asked questions
How many questions does the Locators and Interactions mock test have?
The question bank has 200 questions. Each test picks 20 at random, favouring questions you have not seen, so about 10 attempts cover the full bank.
What is the pass mark?
You pass a test with 70% or more, which is 14 of 20 questions correct.
Can I retake the test?
Yes. Retake as often as you like. Every retake draws a fresh set of 20 questions and counts toward your 20-exam readiness target.