Some website may ask me different questions with pop-up alerts.
I can catch them with Selenium (python)
. But can not see their text.
I tried
an_alert_object = driver.switch_to.alert
and
an_alert_object = selenium.webdriver.common.alert.Alert(driver)
and
an_alert_object = WebDriverWait(driver,10).until(EC.alert_is_present())
I do always avoid NoAlertPresentException
I can do
an_alert_object.accept()
in any way.
But I never can get an_alert_object.text
it is always empty. Why?
What am I doing wrong ? How can I get the text of an alert (actually it is confirm box)?