1

I'm trying to automate the process of logging into a Sharepoint folder and downloading some files. I get past the username stage, then I receive a popup window asking me to select a certiciate for login. The browser tab then pinwheels and when I close it, I get the below error message.

"Traceback (most recent call last):
  File ".\CSSDownloads.py", line 17, in <module>
    driver.switch_to_alert.accept()
AttributeError: 'function' object has no attribute 'accept'"

I tried the below code:

driver.find_element_by_id("certauth").click()
driver.implicitly_wait(3)
elem = driver.find_element_by_xpath("/html/body/script[1]")
elem.send_keys(Keys.RETURN)

And the below:

driver.find_element_by_id("certauth").click()
driver.implicitly_wait(3)
driver.switch_to_alert.accept()

Normally I'd expect either of the above to progress to the Sharepoint page I'm looking for, but my browser seems to just wait for the next action until I close it and I see the above error message in Powershell.

Otto
  • 22
  • 4
  • 1
    Welcome to stack! [This question has some possible solutions](https://stackoverflow.com/q/49512058/1183506). There may be a newer solution but in the past selenium hasn't dealt with those alerts very well outside of the most basic ones. I'd probably take the approach of using robot. – mrfreester May 09 '19 at 15:34

0 Answers0