10

I got this error running a test in Cypress:

Timed out retrying after 10050ms: cy.click() failed because this element is not visible:

How can I click on it anyway? It's just a menu item and I don't need it to be visible for my test.

Andrio
  • 1,852
  • 2
  • 25
  • 54

1 Answers1

17

You have to add {force: true} and it should make the click happen:

cy.get('locator').click({force: true})
Alapan Das
  • 17,144
  • 3
  • 29
  • 52