Playwright · Middle · Question 33 of 75
What does locator.and() do?
- 1Runs two locators and joins all their results
- 2Matches elements that satisfy both locators
- 3Waits for one locator, then the other one
Show the answer
Correct answer: Matches elements that satisfy both locators
Explanation
For example page.getByRole('button').and(page.getByTitle('Subscribe')) finds a button that also has that title.