Hidden submit button breaking cypress tests

I’m not sure whether this is a new change, but recently our Cypress automation tests started failing because of this command:


This was due to there being two submit buttons present in the DOM. One of the buttons is hidden, but cypress still gets confused about which one to click.

The fix was to replace this line with an enter keypress, but I just thought I’d mention it.


Hey there!

Thanks for sharing it with the rest of community! I’m gonna make it more visible to others and share the solution here and highlight it:


The fix was to replace this line with an enter keypress.

1 Like

Thanks! We ran into this same issue and the solution fixed it for us. Just an additional note to do this for both Username and Password

1 Like

I ran into this today too. Thanks for the fix! Here’s what I had before:

cy.get('input[name=password]').type(password, {log: false});


cy.get('input[name=password]').type(`${password}{enter}`, {log: false});