Reputation: 41
I used the browser.switch_to.alert().accept()
to handle a javascript alert popup.
But I got an error like this:
TypeError: 'Alert' object is not callable
How can I fix this problem?
Upvotes: 4
Views: 14808
Reputation: 13634
Alert object is not callable? Then you should stop calling it. So modify
browser.switch_to.alert().accept()
to
browser.switch_to.alert.accept()
(So remove the ()
after alert
).
Upvotes: 20