Hi,
i'm working in a projet wich contients dynamique selector
as you can see after each refresh the name of the class be changed.
**cy.get(".MuiToolbar-root-201 > :nth-child(1) > div > .MuiButtonBase-root-252 > .MuiButton-label-227 > .MuiSvgIcon-root-255").click();
cy.get(".MuiToolbar-root-504 > :nth-child(1) > div > .MuiButtonBase-root-555 > .MuiButton-label-530 > .MuiSvgIcon-root-558")**
set data tags data-cypress="my-element" instead of accessing through classes. That way your spec files are cleaner too
Read our guide to selecting elements https://on.cypress.io/best-practices#Selecting-Elements
Most helpful comment
Read our guide to selecting elements https://on.cypress.io/best-practices#Selecting-Elements