I
I
Ivan Yakushenko2019-07-06 18:50:11
Python
Ivan Yakushenko, 2019-07-06 18:50:11

How to block notification permission request in Selenium?

How can I block or automatically acknowledge such notifications in Chrome:
5d20c2c268d0e764685837.jpeg
This window can appear on any page and the entire screen area becomes gray, because of this Selenium cannot interact with elements:

is not clickable at point (627, 204). Other element would receive the click:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ScriptKiddo, 2019-07-06
@kshnkvn

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)

Source

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question