I tried:
search_recover_login_button.click()
try:
myElem3 = driver.find_element('xpath', '//*locator').text
return "You've got your password reset!" in myElem3
except TimeoutException:
print ('No users found with this email')
message = driver.find_element('xpath', '//*"]/h1').text
assert message == "You've got your password reset!"
but it doesn't work, even when an incorrect email is used, it always looks OK.
I need to get results:
1 - when user input incorrect email, he will not see the massage "You've got your password reset!" and test will be failed, but when input correct, he go next page and see the message "You've got your password reset!" and test is pass