https://cypress.io logo
How can I handle errors like this?
# i-need-help
a
I get this warning when the passwords don't match. I can't find any selecotr in DOM?
e
You can always use
cy.contains
to match on the entire text if you want to validate the text appears. If I recall certain toast messages are really hard to get selectors for and it would depend on what framework you are using. https://docs.cypress.io/api/commands/contains
a
I've already tried with cy.contains and it can't find this text.
e
Do you have any code snippets you can share of what you've tried?
g
that popup is not in the DOM, that is browser showing you outside the DOM, See https://glebbahmutov.com/cypress-examples/recipes/form-validation.html
a
You are a life saver. And a great teacher. Keep up the good job and keep inspiring people. Thanks a lot!
2 Views