click element only if visible and don't fail if not visible #23237
HemanthKu-Kore
started this conversation in
General
Replies: 2 comments
-
hello! 👋 have you tried this
as mentioned here? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@stavares843 cy.get('button') will fail if the DOM doesn't have that element. I need something like this in cypress. Below is a selenium code in java.
Cypress should wait until the element exists and visible AND then click on it. It should not fail if the element doesn't found. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How can we verify the element is visible before clicking on it AND if the element is not visible, the test should not fail and move to next step.
Beta Was this translation helpful? Give feedback.
All reactions