Why switching to alert through selenium is not stable?
As per your code block there are a couple of issues which you need to address as follows : Switching to an Alert : The method switch_to_alert() is Deprecated and you should be using switch_to.alert instead. The API Docs clearly mentions the following : def switch_to_alert(self): “”” Deprecated use driver.switch_to.alert “”” warnings.warn(“use driver.switch_to.alert instead”, DeprecationWarning) … Read more