Issue
How do I handle an optional modal message that pops up on the screen while using Selenium Robot Framework. For example Insufficient balance alert. I cannot see the current balance on the account, that is retrieved from back end. Depending on the balance the pop up may or maynot show up..
Solution
Below code may solve your problem:
try:
modal = browser.switch_to.alert
modal.accept()
except:
# YOUR NORMAL CODE IF MODAL IS NOT GENERATED
Answered By - Devam Sanghvi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.