Consider example of logging in with invalid password to gmail. It gives following error message on the response page:
The email or password you entered is incorrect.
Here are few lines in the HTTP response, related to the error message:
The email or password you entered is incorrect.
<a href=“https://support.google.com/accounts/bin/answer.py?answer=27444&hl=en&ctx=ch_ServiceLoginAuth&p=mail”
target="_blank" class=“help-link”>?
I tried to check the error message with following check:
.check(regex(“The email or password you entered is incorrect.”))
The check is failing. I tried with some more checks as follows, but they are failing too:
.check(xpath("//span[text()=‘The email or password you entered is incorrect.’]"))
.check(xpath("//span[@id=‘errormsg_0_Passwd’]"))
.check(css("#errormsg_0_Passwd"))
.check(css(".error-msg"))
Could you please help me understand why above check statements are failing?