StoreConfirmation always displays error message "There were no confirmations"

Everytime I try to use the command storeConfirmation or storeAlert it fails saying there were no confirmations. How can I fix this?

This is the code Im using:

open https://www.w3schools.com/js/tryit.asp?filename=tryjs_confirm
selectFrame index=0
clickAndWait //button[@onclick='myFunction()']
assertConfirmation Press a button!
storeConfirmation Confirmation

AssertConfirmation will always render the following message as well:

[error] Confirmation message doesn’t match actual message

This is my code:

open https://www.w3schools.com/js/tryit.asp?filename=tryjs_confirm
selectFrame index=0
clickAndWait //button[@onclick='myFunction()']
assertConfirmation Press a button!
storeConfirmation Confirmation

I’ve had an issue with working this one out myself.

One thing i’m pretty clear on though is that the example the Reference tab refers to doesn’t exist at the moment in the Katalon Recorder Samples page.

I’ve noticed that setting up the script to click something on next confirmation allows assertConfirmation to work, but this fails to work when you do not specify this step before clicking on the button.

I have been unable myself to get storeConfirmation (and verifyConfirmation) to function as expected in any scenario i’ve tried too.

2018-07-25_14-18-49.png

Ive managed to get assertConfirmation to work by following the code in this answer I got here:

But I still cant get storeConfirmation to work.