How can I graciously tell that find
didn't find searched element in order to continue test execution?
#14245
Unanswered
quad5
asked this question in
Questions and Help
Replies: 1 comment
-
It is an example of conditional testing https://on.cypress.io/conditional-testing which we do not recommend. Maybe in your case cy.wait(20000)
cy.get('body').then(body => {
// now use body.find
// and if the button is there, click on it
// using cy.wrap(found).click()
}) |
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
-
If
find
didn't find search element, what can we do to continue the execution? Currently, it just stops test and continue to run when it found it.cy.get('body').find('.closeX', {timeout: 20000}).then((el) => {})
Error message:
Timed out retrying: Expected to find element: .closeX, but never found it. Queried from element: <body>
Beta Was this translation helpful? Give feedback.
All reactions