0

I am using the Python wrapper for Selenium, Splinter, to make purchases on an online store. Randomly, the browser throws an UnexpectedAlertPresentException. I don't know where in my process this error will be thrown, and it seems ridiculous to check for this alert and dismiss it all the time. Is there a way to specify to the driver that alerts should be automatically dismissed?

sardine
  • 13
  • 5

1 Answers1

0

You can override the window.alert method using browser.execute_script. See for eg. http://itreallymatters.net/post/1482786902/testing-webpages-with-javascript-popups-correctly#.VUvFhNS1Gko

sureshvv
  • 4,234
  • 1
  • 26
  • 32