Cypress Locators Strategy

Masood Ahmad
Nerd For Tech
Published in
Jun 6, 2021

In this session we are going to learn how can we build cypress locators, As a Cypress engineer you all are familiar that cypress supports only CSS selectors or known as jQuery selectors.so in this blog we are going to learn how to create CSS selectors.

Locate element with Cypress

with the help of Cypress we can locate the element as given below

locate element from inspect element

so by seeing the above tabular you can make your own locators and that makes things easy in cypress.

So by in case if you are not familiar with CSS selectors, then you can opt for Cypress-xpath plugins that I have already explained in Cypress-xpath .

Cheers !!

Note: If you have any query feel free to post here !!

--

--

Masood Ahmad
Nerd For Tech

Automation Testing| Selenium WebDriver | Java |API Testing | Cypress |