What are Cypress Locators?

What are Cypress Locators?

Hi @junior.milton,

Cypress locators are used for locating elements in the HTML Document Object Model (DOM). Locators are generally classified in the following categories:

  • tags – Locate WebElements using HTML tags

  • ids – Locate WebElements using the ID of the elements

  • name – Locate WebElements using name attribute that is set for elements (especially form input elements)

  • class – Locate WebElements by class value

  • links – Locate WebElements by links text property

  • attributes – Locate WebElements by one or multiple sets of attributes

1 Like