Just for your reference, I would quote the source code of verifyElementAttributeValue() method of the com.kms.katalon.core.webui.keyword.builtin.VerifyElementAttributeValueKeyword class.
@CompileStatic
public boolean verifyElementAttributeValue(TestObject to, String attributeName, String attributeValue, int timeOut, FailureHandling flowControl) {
WebUIKeywordMain.runKeyword({
boolean isSwitchIntoFrame = false
try {
WebUiCommonHelper.checkTestObjectParameter(to)
logger.logDebug(StringConstants.COMM_LOG_INFO_CHECKING_ATTRIBUTE_NAME)
if (attributeName == null) {
throw new IllegalArgumentException(StringConstants.COMM_EXC_ATTRIBUTE_NAME_IS_NULL)
}
timeOut = WebUiCommonHelper.checkTimeout(timeOut)
isSwitchIntoFrame = WebUiCommonHelper.switchToParentFrame(to, timeOut)
WebElement foundElement = WebUIAbstractKeyword.findWebElement(to, timeOut)
if (foundElement.getAttribute(attributeName) != null) {
if (foundElement.getAttribute(attributeName).equals(attributeValue)) {
logger.logPassed(MessageFormat.format(StringConstants.KW_LOG_PASSED_OBJ_X_ATTRIBUTE_Y_VALUE_Z, to.getObjectId(), attributeName, attributeValue))
return true
} else {
WebUIKeywordMain.stepFailed(
MessageFormat.format(
StringConstants.KW_LOG_FAILED_OBJ_X_ATTRIBUTE_Y_ACTUAL_VALUE_Z_EXPECTED_VALUE_W,
to.getObjectId(), attributeName, foundElement.getAttribute(attributeName), attributeValue), flowControl, null, true)
return false
}
} else {
WebUIKeywordMain.stepFailed(MessageFormat.format(StringConstants.KW_LOG_FAILED_OBJ_X_HAS_ATTRIBUTE_Y, [to.getObjectId(), attributeName] as Object[]), flowControl, null, true)
return false
}
} catch (WebElementNotFoundException ex) {
WebUIKeywordMain.stepFailed(MessageFormat.format(StringConstants.KW_LOG_WARNING_OBJ_X_IS_NOT_PRESENT, to.getObjectId()), flowControl, null, true)
} finally {
if (isSwitchIntoFrame) {
WebUiCommonHelper.switchToDefaultContent()
}
}
return false
}, flowControl, RunConfiguration.getTakeScreenshotOption(), (to != null) ? MessageFormat.format(StringConstants.KW_MSG_CANNOT_VERIFY_OBJ_X_ATTRIBUTE_Y_VALUE_Z, to.getObjectId(), attributeName, attributeValue)
: StringConstants.KW_MSG_CANNOT_VERIFY_OBJ_ATTRIBUTE_VALUE)
}
As you can see, the method can potentially emit 3 types of message string for StepFailedException.
- StringConstants.KW_LOG_WARNING_OBJ_X_IS_NOT_PRESENT
- StringConstants.KW_LOG_FAILED_OBJ_X_HAS_ATTRIBUTE_Y
- StringConstants.KW_LOG_FAILED_OBJ_X_ATTRIBUTE_Y_ACTUAL_VALUE_Z_EXPECTED_VALUE_W
Which message did you find in the log when you run your test?
With the message type identified, you will have better idea what’s going on.