Playwright · Middle · Question 35 of 75
Do Playwright locators work inside open shadow DOM?
- 1Yes, they pierce open shadow roots by default
- 2No, you need a special shadow selector syntax
- 3Only XPath selectors can reach shadow DOM
Show the answer
Correct answer: Yes, they pierce open shadow roots by default
Explanation
CSS and role locators look into open shadow roots automatically. XPath does not, and closed shadow roots aren't reachable.