I want to find out when an alert happens so I can automatically accept. I've placed self.driver.switch_to.alert.accept() in various places in the code but I always get a selenium.common.exceptions.NoAlertPresentException. When I don't place it anywhere I get an selenium.common.exceptions.UnexpectedAlertPresentException. When I use expected_conditions I get a selenium.common.exceptions.TimeoutException. I don't know what to do at this point. Can anyone help?
Python/Django Backend. Using Selenium (Firefox)
I don't think there's a method for that, but if you know it will happen, make a while loop with try-catch block until the alert happens
python selenium - how can i find out exactly when an alert happens?