how can i remove notifications and alerts from browser? selenium python 2.7.7

0
0

I am trying to submit information in a webpage, but selenium throws this error:

UnexpectedAlertPresentException: Alert Text: This page is asking you
to confirm that you want to leave – data you have entered may not be
saved. ,
>

It’s not a leave notification; here is a pic of the notification –

enter image description here.

If I click in never show this notification again, my action doesn’t get saved; is there a way to save it or disable all notifications?

edit: I’m using firefox.

  • You must to post comments
0
0

You can disable the browser notifications, using chrome options. Sample code below:

chrome_options = webdriver.ChromeOptions()
prefs
= {"profile.default_content_setting_values.notifications" : 2}
chrome_options
.add_experimental_option("prefs",prefs)
driver
= webdriver.Chrome(chrome_options=chrome_options)
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website