Failure Handling didn't work


#1

Hi guys,

I have created a test case where I have verified a element for its visibility, and set the failure control of the function as CONTINUE.ON.FAILURE. The whole test got executed correctly but at last the test got failed because of the same element which was not visible.

Can anybody tell me the reason why it is happening.

boolean isContentVisible = Mobile.verifyElementVisible(findTestObject(‘Object Repository/Favorite/FavoriteLogo’), 4, FailureHandling.CONTINUE_ON_FAILURE)

The test got passed when I made the control as OPTIONAL.

Thanks!!!


#2

all is described in documentation here:
https://docs.katalon.com/display/KD/Failure+Handling


#3

@Andrej Podhajský

According to the explanation in the document section the test case should continue after failure, but in my case the test gets stopped and the status of the test case shows failure, rather than failing at step and move forward with the test case.

Please help me on this.


#4

hello,
i dont get it … in original question you stated:

*** cut ***
set the failure control of the function as CONTINUE.ON.FAILURE. The whole test got executed correctly but at last the test got failed because of the same element which was not visible.

is something else then:

*** cut ***
test case should continue after failure, but in my case the test gets stopped and the status of the test case shows failure

in 1st post you are telling that test get executed as it should but status was failure - which is correct

easy way how to test it is :
new TC and change failure control and check in console:

boolean isContentVisible = Mobile.verifyElementVisible(findTestObject('Object Repository/Favorite/FavoriteLogo'), 4, FailureHandling.CONTINUE_ON_FAILURE)println '*** After Failure ***'

if you will see text you know where execution was


#5

Hi

Sorry for the contradictory statements

The problem was test gets execute perfectly with CONTINUE.ON.FAILURE, but when the execution gets completed the status of test case comes as FAILURE instead of PASSED.


#6

That’s how it is supposed to work. If you want the test PASSED, set FailureHandling.OPTIONAL.


#7

Mate Mrse said:

That’s how it is supposed to work. If you want the test PASSED, set FailureHandling.OPTIONAL.

and failed steps in TC will have warning mark on them


#8

Ok… got it…

Thanks!


#9

I have a Issue with my test case. Test gets execute perfectly with CONTINUE.ON.FAILURE, but the LAST Test getting frailer even if it’s executed completely

Test 1-Verify Test Present -CONTINUE.ON.FAILURE-Showing Failed status as element is not present
Test 2-Close Browser -STOP ON FAILURE-Showing Failed status even if executed successfully and close the browser