[WebUI] Verify Element Has Attribute


This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/docs/webui-verify-element-has-attribute.html

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

What is wrong here? Is this a bug?

Have you tried the FailureHandling.OPTIONAL option?
WebUI.verifyElementHasAttribute(findTestObject, String Attribute, timeout, FailureHandling.OPTIONAL)