Manually end test case

Hi,

im wondering if i can manually end a testcase and mark it as “success”?

It looks like this:

while ( element clickable == true ) {

operations…

**}

**Obviously, if the element is not clickable anymore, katalon is leaving the loop and marking the test as a failure. Any idea how i could mark the test as success if the loop is left?

Yes you can,

import com.kms.katalon.core.util.KeywordUtil
KeywordUtil.markPassed("This is pass message")
1 Like

FachrulCH said:

Yes you can,

import com.kms.katalon.core.util.KeywordUtil

KeywordUtil.markPassed(“This is pass message”)


  

  

Which begs the question, can KeywordUtil.markPassed be used when the code itself is not part of a Keyword?

I’ll test it and post my findings…

Russ Thomas said:

FachrulCH said:

Yes you can,

import com.kms.katalon.core.util.KeywordUtil

KeywordUtil.markPassed(“This is pass message”)


  

  

Which begs the question, can KeywordUtil.markPassed be used when the code itself is not part of a Keyword?

I’ll test it and post my findings…

Excellent! KeywordUtil.mark* can be used anywhere it seems, not just inside Keyword code.
Thanks for nudging me in this direction, Fachrul. :slight_smile:

Actually the keyword will not end the Test Case, more then that - you still can get an error if it fails after the Keyword statement.
Only Error and Failed Keywords will stop the test case immediately

1 Like