Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I ignore an alert using selenium + chrome webdriver + python?

I need to ignore the alert raised by Chrome Webdriver: Alert Screenshot

I am trying using: browser.switch_to.alert.accept but it is not working.

I already set up the option as:

chrome_options = Options()
chrome_options.add_argument("--disable-notifications")

But I believe the alert is not a notification object.

Thank you for your help!

like image 292
Marcelo Gazzola Avatar asked Mar 27 '19 12:03

Marcelo Gazzola


People also ask

How do I stop pop ups in Selenium Python?

To dismiss a popup, the method switch_to. alert(). dismiss() is used. To obtain the text on a popup, we have to use the switch_to.


1 Answers

Have you tried this.

chrome_options = Options()
chrome_options.add_argument("--disable-popup-blocking")
like image 140
KunduK Avatar answered Sep 18 '22 10:09

KunduK