Reputation: 41
In Firefox this popup(screenshot of the popup) is coming as a window kind of thing and also I am able to save the option as default. But in chrome it is coming as alert kind of popup. How to click the button in this popup using selenium?
Upvotes: 0
Views: 367
Reputation: 897
Python alert handling
#Switch the control to the Alert window
obj = driver.switch_to.alert
#Retrieve the message on the Alert window
msg=obj.text
print ("Alert shows following message: "+ msg )
#use the accept() method to accept the alert if want to dismiss
obj.accept()
or if you want to dismiss it
obj.dismiss()
Upvotes: 1