-1

How i find xpath for the messeage error up for testing

I try all and didnt find how to get to the error messeage thx for the help

1

1 Answer 1

2

Looks like that is an alert.

You will have to switch to it before extracting the text.

try:
    time.sleep(2)
    Alert = driver.switch_to.alert
    print(Alert.text)
except:
    print('Could not interact with Alert')
    pass
Sign up to request clarification or add additional context in comments.

1 Comment

You can assert like this "assert "paste error message here" in Alert.text"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.