[WebUI] Verify Element Attribute Value

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


Is there a way to verify multiple values? For example what I want is the test to continue if the value is either 500 or 501:

WebUI.verifyElementAttributeValue(findTestObject(‘Page_Client Settings/Limit ProductName’), ‘value’, ‘500’ || ‘501’, 20)

But it’s failing when I write it this way.

String v = WebUI.getAttribute(findTestObject(...), 'value')
if (v == '500' || v == '501') {
    println "I've got 500 or 501"
} else {
    println "something else"

Another way might be to use RegEx (set the RegEx boolean to true).

WebUI.verifyMatch(WebUI.getAttribute(findTestObject('Page_Client Settings/Limit ProductName'), 'value'), "50[0-1]", true)
1 Like