
I try all and didnt find how to get to the error messeage thx for the help
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
"assert "paste error message here" in Alert.text"