Skip to content
Advertisement

Not able to find the locator which is inside a component in Cypress

I am trying to find the dropdown-arrow locator. I have used the cypress cmd – cy.get('.dropdown-arrow').click() but it gives element not found error.

Here is my code

JavaScript

Advertisement

Answer

From comments, shadow DOM is present. You can access elements within it either by adding this to cypress.json

JavaScript

or in the test

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement