No signature of method - verifyAlertNotPresent

Hi, anyone can advice how to use verifyAlertNotPresent()? I was trying to loop if alert is not present:

for (int i = 0; i < 2; i++) {
if (WebUI.verifyAlertNotPresent(2) {
WebUI.click(BtnDelete’))
WebUI.delay(2)
}

But it is giving this error, and I’m not sure how to fix :frowning:

Reason:
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyAlertNotPresent() is applicable for argument types: (java.lang.Integer, applicationfunction.AdjustmentFunctions$_fn_deleteAdjustment_closure1) values: [2, applicationfunction.AdjustmentFunctions$_fn_deleteAdjustment_closure1@37637a24]
Possible solutions: verifyAlertNotPresent(int), verifyAlertNotPresent(int, com.kms.katalon.core.model.FailureHandling), verifyAlertPresent(int), verifyAlertPresent(int, com.kms.katalon.core.model.FailureHandling), verifyTextNotPresent(java.lang.String, boolean)

You are missing a closing )

image

1 Like

Gosh, how can I not noticed for so long :upside_down_face:
Thanks a lot @Russ_Thomas

2 Likes

You likely already noticed the if() condition was closed after the WebUI.click() but I am surprised you didn’t see any syntax complaints live in the editor since the block structure was clearly broken – i.e. the closing } at the end – is that the if or the for?

Weird. Anyway, that’s all academic now since you got it fixed :nerd_face:

1 Like

Yeah, I was able to run the test without any complaint from KS. Probably I was too focus on the error and did not notice the missing bracket. Will be more careful next time! :grinning: