As suggested by @DebanjanB the popup which is clearly visible between the WebDriverWait starts
and WebDriverWait ends
message may not be an alert. How do we press allow in such case.
chrome_options = webdriver.ChromeOptions()
prefs = { "profile.default_content_setting_values.notifications" : 2 }
chrome_options.add_experimental_option("prefs", prefs)
driver = webdriver.Chrome(chrome_options=chrome_options, executable_path=CHROME_DRIVER_PATH)
driver.get(url)
try:
print("WebDriverWait starts")
WebDriverWait(driver, 10).until(EC.alert_is_present(), 'Timed out waiting for PA creation confirmation popup to appear.')
alert = driver.switch_to.alert
alert.accept()
print("alert accepted")
except TimeoutException as e:
print("WebDriverWait ends: ", e)
pass
WebDriverWait starts
WebDriverWait ends: Message: Timed out waiting for PA creation confirmation popup to appear.