Testing · Junior · Question 66 of 78
How do you find an element in Cypress by a dedicated test attribute?
- ✓Correct answer:
cy.get('[data-cy="submit"]') - 2
cy.find("submit") - 3
cy.select("#submit")
Explanation
Cypress recommends data-cy/data-test attributes: they don't change with styling. cy.contains("Submit") searches by text.