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!