Katalon recorder assertConfirmation does not work


#1

I was trying to implement assertConfirmation but it does not work, it always returns a error saying the message is not the same even if the message is copied directly from the javascript code.

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

#2

German Cons Tapia said:

I was trying to implement assertConfirmation but it does not work, it always returns a error saying the message is not the same even if the message is copied directly from the javascript code.

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

Hi German,

We have tried your code and it run perfectly at our end. Would you please double check again?

Let us if it works!

Thank you for using Katalon products,
Liam

Screen Shot 2018-07-24 at 5.02.59 PM.png


#3

Ok I got it to work using your example thank you.

p.s. Im trying to use storeConfirmation right after assertConfirmation but it gives me the error “there were no confirmations”


#4

I have the same problem but I found no help, and no solution works.

If I record the example scenario described above, it works when I play it: the assertConfirmation command gives a green result.

If I record a similar scenario in my website, when I play it, I get “Confirmation message doesn’t match actual message”.

I cannot give any links here, since we are working in development environments, but here is an extract of the code automatically generated when recording:

image.png


#5

Getting the same error as Eric.

Katalon recorder logs that I have clicked a sign out link, which produces a popup with some text. When I click on ‘Ok’ or ‘Cancel’ within the popup Katalon is recording a step before ‘ChooseOkOnNextConfirmation’ and a step after ‘assertConfirmation’ - which attempts to assert the text that was in the popup.

This continually fails, despite the confirmation text matching what is in the alert.

How do I capture what is in the popup? The example given above on w3schools works but I notice that an extra step is there picking a frame, which does not happen in my example.


#7

I also have the same problem (not matching the text).

I first thought that it was due to a couple of line breaks in the pop-up message (you know, a br in a <> I can’t add it here properly because this editor adds a new line!)

I have that BR problem in a few places (I’m porting tests from Selenium IDE) but I have got round it by removing the BR and adding a wild card (*) instead. The wild card trick doesnt work here. You can replace all the text with a wildcard, and it still wont match, so now I’m wondering whether wild cards work on this particular assertation.

What would be great is if Katalon rather than just saying that the text doesn’t match what was expected and printing what was expected to log, if it also added what text it got to the log too (line Selenium IDE does). That would help a lot in trouble shooting.

Anyway, it would be great if someone has found a workaround for this…?