Commands like verifyElementVisible, verifyElementNotVisible, verifyElementPresent, verifyElementNotPresent, verifyElementHasAttribute, etc. returns an exceptions instead of boolean false if the condition fails.
All these commands are marked with return type as boolean, however, there is no proper handling to it and throws exception if condition fails.
As a workaround, I am using it like below , bu this is not an optimal solution as you end up with unwanted warnings in the console logs.
if (WebUI.verifyElementNotPresent(findTestObject(‘ab/xyz/rrr’),10,FailureHandling.OPTIONAL)
Hey, Thanks for the help and don’t be sorry. Appreciate your help here.
I really cannot categorize this as a new feature for Katalon team, its a defect in existing code itself that should get fixed in the product. I am not sure if a defect is already logged for this or not.
I’d say it’s more like non-existing feature - I also use FailureHandling.OPTIONAL for preventing exceptions, but I don’t care about warnings - but I agree, it may be annoying.
@devalex88@ThanhTo Guys, could you create this feature request and prioritize it in your project? Thank you!
In Katalon Studio 7.0.0, we have already fixed the bug that caused the verifyElementPresent() and verifyElementNotPresent() keywords to throw an exception instead of returning false when the verified elements do not exist.
Please first check out the release note and click here to download if you want to try version 7.0.0 (beta) in advance.
It’s only for the two keywords. Other keywords still require that the elements exist. You can combine them with verifyElementPresent() and verifyElementNotPresent().
I am aware these functions , but what I was trying to share that while consuming these methods , they will not return false rather returns an exception.
Hence, the issue raised for verifyElementPresent is applicable to other verify** methods too !!