Cypress Click with Relative Coordinates

Profile picture for user arilio666

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.

Cypress Click with Relative Coordinates