Friday, November 4, 2011

Selenium RC and Confirmation Dialogs

This is worth noting. Sometimes in Selenium RC you will click on a button and it will bring up a confirmation dialog (Are You Sure You Want To Do This?)

Here's how to handle it in python-selenium


sel.choose_ok_on_next_confirmation() # will 'ok' the next one that comes up
sel.click('link='Delete') # your delete button
sel.get_confirmation() # absorbs the confirmation dialog

No comments:

Post a Comment