SafariDriver cannot handle alert displays after driver.get(url)

39 views
Skip to first unread message

Thanh hoang ngoc

unread,
May 24, 2018, 10:27:40 PM5/24/18
to Selenium Users
After I navigate to a page that has authentication, the login alert displays. Therefore, I handle it as the below way (It works on Firefox, but not work on Safari)
browser = webdriver.Firefox()
browser.get("url")
browser.find_the_element_by_id("add_button").click()
WebDriverWait(browser, 3).until(EC.alert_is_present(),
                                   'Timed out waiting for PA creation ' +
                                   'confirmation popup to appear.')
alert = browser.switch_to.alert
alert.send_keys("username" + Keys.TAB + "password")
alert.accept()
Please help me!

David

unread,
May 25, 2018, 8:19:31 PM5/25/18
to Selenium Users
Which version of Safari and which version of Selenium?

Thanh hoang ngoc

unread,
May 25, 2018, 9:16:24 PM5/25/18
to Selenium Users
Hi David, I'm using Safari 11.1 and selenium 3.12, language Python
Reply all
Reply to author
Forward
0 new messages