Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Popup documentation
https://www.selenium.dev/documentation/webdriver/b...
# Click the link to activate the alert
driver.find_element(By.LINK_TEXT, "See a sample confirm").click()
# Wait for the alert to be displayed
wait.until(expected_conditions.alert_is_present())
# Store the alert in a variable for reuse
alert = driver.switch_to.alert
# Store the alert text in a variable
text = alert.text
# Press the Cancel button
alert.dismiss()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question