Skip to content
Discussion options

You must be logged in to vote

The easiest way to locate Shadow DOM elements in Cypress is to add a unique ID or data attribute to the element and then use Cypress’s shadow() command:

cy.get('parent-selector').shadow().find('#uniqueID')

Or enable shadow DOM globally:

Cypress.config('includeShadowDom', true)
cy.get('#uniqueID')

Hopes this helps.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MicheleSalz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants