Skip to content
masterclass Buddy

Cypress · Function

cy.findByRole

cy.findByRole is a Cypress Testing Library query that finds an element by its accessible role and name. Cypress also provides cy.getByRole() as a built-in alternative.

Last updated

Syntax

cy.findByRole(role, options?)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • cy.getByRole()
  • @testing-library/cypress
  • findByLabelText
  • findByText
  • findByTestId
  • Cypress Accessibility

Source: Cypress best practices | Cypress Documentation. Checked 2026-11-03.