I’m trying to automate a process using selenium and python (and I’m on a Mac) and after using selenium to click a button on the site, an alert (which I can only describe as “chrome specific”) pops up. It wants me to allow sharing my clipboard and this is what it looks like:The alert I get
I have tried using
driver.switch_to.alert.accept()
and
WebDriverWait(driver, 10).until(EC.alert_is_present())
alert_msg = driver.switch_to.alert
alert_msg.accept()
but neither of these have worked; the first one just comes up with an error saying “no such alert” and the second one just times out after not finding the alert. I think it may have something to do with it being a chrome specific alert and the fact that I’m using a Mac, but I’m completely unsure. I am also wondering if there is another way to automatically accept this type of alert using some sort of option like this:
prefs = {"Some sort of preference involving allowing clipboard" : True/"allow"/etc.}
options.add_experimental_option("prefs", prefs)
driver = webdriver.Chrome(options=options)
Any help is much appreciated and thanks in advance.
Brendan Graziani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.