Skip to content

self.click with alert seems to have issues #1182

Answered by mdmintz
maburrub asked this question in Q&A
Discussion options

You must be logged in to vote

That's expected behavior based on how Webdriver works. Calling any type of script while an alert is open will dismiss the alert, and a script is used to verify that the document.readyState of the page is complete after various actions such as clicking. More details on that here: #600

There are also many who consider that a feature because sometimes they want alerts to get dismissed automatically. For your situation, use self.get_element(alert_locator).click() as needed to make sure the alert stays up if you need it to stay up.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by mdmintz
Comment options

You must be logged in to vote
1 reply
@mdmintz
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants