Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

Cypress – Locators

Category: Cypress

Cypress only supports the Cascading Style Sheets (CSS) selectors to identify the elements.However, it can also work with xpath, with the help of the ‘Cypress-Xpath’ plugin.

Syntax with attribute-id and tagname is tagname#id − input#user_email_login or #user_email_login

Syntax with attribute-class and tagname is tagname.class − input.user_email_ajax or .user_email_ajax

Syntax with any attribute value and tagname is tagname[attribute=’value’] − input[id=’user_email_login’]

Leave a Reply

Your email address will not be published. Required fields are marked *