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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Thanh hoang ngoc
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!

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/fb438a33-d3ab-4985-81ee-3db9aa913e0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

David
Which version of Safari and which version of Selenium?

On Thursday, May 24, 2018 at 7:27:40 PM UTC-7, Thanh hoang ngoc wrote:
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!

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/3378db8b-9bb9-4d0e-aab1-cbc3ad52c832%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Thanh hoang ngoc
Hi David, I'm using Safari 11.1 and selenium 3.12, language Python

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/513145fb-db99-4f2c-a9dc-985f0262e9a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.