'Alert pop up does not go away
I am automating a webpage where after refreshing, Chrome throws a confirmation pop-up to reload, I am handling this using driver.switch_to.alert.accept(). The problem is that even after the alert is accepted, the pop up still remains on the webpage. My script proceeds further but fails since no action can be done until the pop is gone. Any help would be greatly appreciated. I am using Python and selenium to automate.
FYI i also tried the following but no luck
self.chrome_options.add_argument("--disable-popup-blocking")
self.chrome_options.set_capability('unhandledPromptBehavior', 'accept')
self.chrome_options.set_capability("UNEXPECTED_ALERT_BEHAVIOUR", "ACCEPT")
self.chrome_options.set_capability("unexpectedAlertBehaviour", "accept")
self.chrome_options.set_capability("CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR", "ACCEPT")
self.chrome_options.set_capability("UnexpectedAlertBehaviour", "ACCEPT")
webdriver.DesiredCapabilities.CHROME["unexpectedAlertBehaviour"] = "accept"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
