assertAlert, assertConfirmation, assertPrompt
assertAlert (text), assertConfirmation (text), assertPrompt (text)
assertAlert and its friends are used to check on the correct text of the various Javascript dialog boxes. See also answerOnNextPrompt. If all you need is to confirm (click) a dialog, they are not needed. They are only useful for creating web testing macros, when you need to confirm that the text on a dialog is correct.
In the classic Firefox Selenium IDE there are also the corresponding "verify" versions verifyAlert, verifyConfirmation, verifyPrompt. The Ui.Vision RPA implementation of the Selenium IDE does not support these three commands - as they are no longer needed. The reason is that while in the Firefox IDE the verifyAlert (etc) commands are useful if a dialog box randomly appears and you just want to close it. Ui.Vision RPA for Chrome closes dialog boxes by default, unless you tell it otherwise. The reason for this behavior is that in 99% of all automation cases users just want to close dialog boxes and move on. So there should be no need for the "verify..." versions of this command. But if you need them, let us know.
Why is chooseOkOnNextConfirmation no longer needed?
In the classic Firefox Selenium IDE you needed to add a chooseOkOnNextConfirmation command if you want the IDE to close a dialog automatically. In the Ui.Vision RPA implementation of the Selenium IDE this command is not needed, as Ui.Vision RPA closes (presses OK) on appearing dialogs automatically. So in other words, chooseOkOnNextConfirmation is built-in, and not needed as separate command. The reason for this behavior is that in 99% of all automation cases users just want to close dialog boxes and move on. The opposite command, chooseCancelOnNextConfirmation, is not yet available in Ui.Vision RPA as it seems to be very rarely used (if at all). But if you need it, let us know.
For Javascript PROMPT dialogs, use answerOnNextPrompt to define the answer that the Selenium IDE should return.
assertAlert, assertConfirmation, assertPrompt Example
The macro below first opens a prompt, and then Ui.Vision RPA IDE closes it automatically. The assertPrompt command is completely optional, and only needed if you want to assert that the dialog did appear and had the correct title.
Command | Target | Pattern/Text |
---|---|---|
open | https://ui.vision/demo/javascript | |
answerOnNextPrompt | Hello World! | - |
click | //*[@id="content"]/div[2]/div/p[2]/button[2] | - |
assertPrompt | Enter some text! | - |
Works in
Ui.Vision RPA for Chrome Selenium IDE, Ui.Vision RPA for Firefox Selenium IDE, Firefox IDE Classic
Related Demo Macros
Demo-Autofill, Demo-Frame
The ready-to-import-and-run source code of all demo macros can be found in the Open-Source RPA software Github repository.
See also
answerOnNextPrompt, Web Automation Extension User Manual, Selenium IDE commands, Classic Firefox Selenium IDE.
Anything wrong or missing on this page? Suggestions?
...then please contact us.