4

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?

1 Answer 1

20

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).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.