Tuesday, 26 January 2021

Selenium + Python: Microsoft Edge Alert - no such alert

When running a process on Selenium, I get a pop-up (which appears to be native to the Edge browser). When trying the following:
browser.switch_to.alert.accept(),
I get the error
selenium.common.exceptions.NoAlertPresentException: Message: no such alert

I've tried waiting some time for the pop up to appear, as well as messing around with the Edge options to no avail.

Another idea I have to is simulate pressing the left arrow key then enter as the pop-up becomes active, however I need to select a specific element on selenium and the pop-up is not found.

from msedge.selenium_tools import Edge, EdgeOptions
options = EdgeOptions()
options.add_experimental_option("prefs", {
    "profile.default_content_setting_values.notifications": 1
})
browser = Edge(options=options)

enter image description here

Perhaps this is a different type of alert?



from Selenium + Python: Microsoft Edge Alert - no such alert

No comments:

Post a Comment