1

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.

enter image description here

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.

ishandutta2007
  • 16,676
  • 16
  • 93
  • 129
  • 2
    What exception did you get? Doubt if that's an alert. – eduPeeth Jul 20 '18 at 10:49
  • Message: Timed out waiting for PA creation confirmation popup to appear. – ishandutta2007 Jul 20 '18 at 10:50
  • @eduPeeth I also suspect so, previously it used to work, now it isn't working as the look and feel of this alert changed slightly. – ishandutta2007 Jul 20 '18 at 10:51
  • But it's an alert because disabling works..`chrome_options.add_argument("--disable-notifications") ` – ishandutta2007 Jul 20 '18 at 10:52
  • @ishandutta2007 What you are seeing in the AUT, historically is not an alert but a notification. Perhaps Andersson as well have pointed you to the right direction. If you feel your question is not a duplicate please edit your question to make it indifferent from the existing dup marked discussion. – undetected Selenium Jul 20 '18 at 10:55
  • @DebanjanB this selenium code is very old and used to work fine till now, now it isn't working as the look and feel of this alert changed slightly – ishandutta2007 Jul 20 '18 at 11:02

0 Answers0