WebUI.verifyElementNotHasAttribute returns error

I have a problem using it. When the attribute is not present, it returns true but if element has the attribute it returns an error:
com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/radiobutton’ has attribute 'checked’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Object ‘Object Repository/radiobutton’ has attribute 'checked’

What is wrong here? Is this a bug? With WebUI.verifyElementHasAttribute it is the exact opposite.

It’s return a StepFailedException which to my reckoning is correct. What are you expecting to happen?

Get boolean false

Bildschirmfoto 2020-12-08 um 09.48.40

Add parameter FailureHandling to OPTIONAL

verifyElementHasAttribute(to, attributeName, timeOut, FailureHandling.OPTIONAL)
1 Like

Okay, OPTIONAL works for me. Now I also see the false return. Thank you very much.