I am trying to compare data in 2 fields and then verify if the number (153.08) in one field is less than the number in another field (236.98)
I can get the attribute of the two fields with the following code and it does print the two totals. Then I am trying to use VerifyLessThan and setting the test objects, but this isn’t working.
value = WebUI.getAttribute(findTestObject(‘Audit/Page_/AT_Billed_Total’), ‘value’)
println('The value is: ’ + value)
value = WebUI.getAttribute(findTestObject(‘Audit/Page_/AT_Audit_Total’), ‘value’)
println('The value is: ’ + value)
WebUI.verifyLessThan(findTestObject(‘Audit/Page_/AT_Audit_Total’), findTestObject(‘Audit/Page_/AT_Billed_Total’))
2020-01-17 13:36:23.664 DEBUG testcase.GL01 - Import GL Code - 87: value = getAttribute(findTestObject(“Audit/Page_/AT_Billed_Total”), “value”)
2020-01-17 13:36:23.933 DEBUG testcase.GL01 - Import GL Code - 88: println("The value is: " + value)
The value is: 236.98
2020-01-17 13:36:23.935 DEBUG testcase.GL01 - Import GL Code - 89: value = getAttribute(findTestObject(“Audit/Page_/AT_Audit_Total”), “value”)
2020-01-17 13:36:24.224 DEBUG testcase.GL01 - Import GL Code - 90: println("The value is: " + value)
The value is: 153.08
2020-01-17 13:36:24.225 DEBUG testcase.GL01 - Import GL Code - 91: verifyLessThan(findTestObject(“Audit/Page_/AT_Audit_Total”), findTestObject(“Audit/Page_/AT_Billed_Total”))
2020-01-17 13:36:24.292 ERROR c.k.k.core.keyword.internal.KeywordMain - Unable to verify actual number ‘TestObject - ‘Object Repository/Audit/Page_/AT_Audit_Total’’ less than expected number ‘TestObject - ‘Object Repository/Audit/Page_/AT_Billed_Total’’ (Root cause: java.lang.IllegalArgumentException: Actual number with value ‘TestObject - ‘Object Repository/Audit/Page_/AT_Audit_Total’’ is not a valid number
at com.kms.katalon.core.helper.KeywordHelper.comparingNumberObject(KeywordHelper.java:62)