Confirm Next

Prepares the processing of the next confirmation dialog.
If your application makes usage of confirmation dialogs (javascript: res=window.confirm(question);), by default WETATOR will close those by clicking the 'OK' button.
Use this command to assert the expected description or to click the 'Cancel' button instead.

Parameters

button
The button to click; only 'OK' and 'Cancel' are allowed here.
message
The text to match against the confirmation dialog.
If the confirmation text of the next dialog does not match, the command that started the dialog (usually a clock-on) will fail. It is possible to use the '*' and the '?' character as wildcards; '*' matches zero or many characters; '?' matches one single character.
It is also possible to define a comma separated list of words (with '*' and '?' if needed). Then this command checks, that the words in the defined order are parts of the page title.
If your assertion contains a comma, star, or question mark, precede it with a backslash.

Examples

The application uses a dialog to get a confirmation from the user.

In this sample the click on the Delete button will open the confirmation dialog and the application deletes all the data only if the user confirms by clicking 'OK'.

Command Parameter Optional Parameter
confirm-next OK Do you really like to delete all data?
click-on Delete
assert-content All date deleted.

If you like to test the correct implementation for the case where the user clicks the cancel button do it like this.

Command Parameter Optional Parameter
confirm-next Cancel Do you really like to delete all data?
click-on Delete
assert-content Nothing deleted.