Skip to content

Stop alert from automatically closing. #1284

Answered by mdmintz
romek-codes asked this question in Q&A
Discussion options

You must be logged in to vote

@RomanJus If you change
sb.click(UserModal.MODAL_ACCEPT_BTN)
to
sb.find_element(UserModal.MODAL_ACCEPT_BTN).click()
does it work correctly for you?

The existing behavior is the default one, unless you use a custom_settings file, such as https://github.com/seleniumbase/SeleniumBase/blob/master/examples/custom_settings.py, and then then change WAIT_FOR_ANGULARJS to be False. That executes JS to make sure everything has loaded, however, if you execute any JS while an alert is up, it'll dismiss the alert (this is part of how Selenium works).

Any one of the above two solutions should be good enough.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@romek-codes
Comment options

Answer selected by mdmintz
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