Playwright · Middle · Question 35 of 75

Do Playwright locators work inside open 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.

Further reading

Problem with a question

Playwright · Middle · question 35

Test yourself

Take the Playwright · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz