In Cypress, we can click using relative coordinates with the help of pixel location.
Syntax:
cy.get().Click(pxlocation)
Example:
cy.visit('https://www.programsbuzz.com/')
cy.get('.fas.fa-search').click(1512, 20 ,{force: true})
Here search icon is clicked with relative coordinates of 1512 and 20 in the top right corner.
- Log in to post comments