Using Selenium, how can I get the contents of a JavaScript confirmation prompt?
Screenshot of the prompt: http://www.freeimagehosting.net/image.php?a296dd8a59.png
Using Selenium, how can I get the contents of a JavaScript confirmation prompt?
Screenshot of the prompt: http://www.freeimagehosting.net/image.php?a296dd8a59.png
Your screenshot shows a JavaScript confirmation prompt. You can use the *Confirmation commands, such as:
verifyConfirmation | The changes you made will be lost
assertConfirmation | The changes you made will be lost
By default Selenium will accept the confirmation, however to influence this use the chooseCancelOnNextConfirmation
or chooseOkOnNextConfirmation
commands.
With Selenium RC you'd use getConfirmation
.
Selenium reference for above commands:
prompt error:There were no confirmations
how to send the command at the right time???
selenium default click ok, and do not display the pop-window.
You need to check if the popup is alert,confirmation or prompt. All three has different functions. Check the source for the same and use the appropriate command in RC or IDE