Checking if object exists should give me a fail


I am trying to verify if some object exists, that is not supposed to exist.

Here is my code:

if(WebUI.waitForElementPresent(findTestObject(‘Object Repository/Page_Login to Shieldox/button_Login’),5)){

    KeywordUtil.markFailed('ERROR: The Filter Results Does NOT Match the      Pagination Results');



   KeywordUtil.markPassed('SUCCESS: The Filter Results Matches the Pagination Results');


And my test fails although it goes to the else statement. How to tell Katalon not to fail.

Add failure handling:

WebUI.waitForElementPresent(findTestObject('Object Repository/Page_Login to Shieldox/button_Login'), 5, FailureHandling.OPTIONAL)
1 Like