Cypress · Middle · Question 18 of 77

How do you query elements inside shadow DOM?

Show the answer

Correct answer: includeShadowDom: true in config or .shadow()

Explanation

With the config option, cy.get searches shadow roots. .shadow() steps into a specific host's shadow root.

Further reading

Problem with a question

Cypress · Middle · question 18

Test yourself

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

Take this quiz