Cypress contains() method to locate elements

Cypress contains() is used to identify the one or more browser element[s] based on the text. Example – In Cypress, The link with text “SignUp Form” can be identified as cy.contains(‘SignUp’).click() or cy.get(‘.myhmenu’).contains(‘SignUp’).click() The above command will locate the element with text ‘SignUp’ based on a parent element .myhmenu Note – contains() can be used…

Understanding cypress get() & get() vs find()

Cypress exposes get() method to identify the browser elements based on the matched selector criteria. Selector is basically the CSS Selector syntaxes or patterns. the overloaded methods are – cy.get(selector) cy.get(selector, options) cy.get(alias) cy.get(alias, options) Note – selector accepts “CSS Selector” patterns get() is always chained with cy object get() method is used to locate…

CSS Selector – Cypress locator strategy

Cypress uses CSS Selector to identify browser elements. If you are coming from Selenium or Protractor background, then you must be familiar with locator strategy CSS Selector. Cypress exposes get() method to identify browser elements. You can refer to below link to get all the CSS Selector syntaxes or patterns. CSS selector patterns All these…