XnivaXhzne
XnivaXhzne

Reputation: 41

How to automate this popup in chrome using selenium?

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

Answers (1)

Alin Stelian
Alin Stelian

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

Related Questions