# Catch Root Cause Message for a failed Test Step even outside a Test Case

**URL:** <https://forum.katalon.com/t/catch-root-cause-message-for-a-failed-test-step-even-outside-a-test-case/11893>\
**Category:** Feature Request\
**Tags:** feature-request, katalon-studio\
**Created:** [July 5, 2018, 1:05pm UTC](https://forum.katalon.com/t/catch-root-cause-message-for-a-failed-test-step-even-outside-a-test-case/11893 "2018-07-05T13:05:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drunda\_Nibel](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@Drunda\_Nibel](https://forum.katalon.com/u/Drunda_Nibel)\
**Post date:** [July 5, 2018, 1:05pm UTC](https://forum.katalon.com/t/catch-root-cause-message-for-a-failed-test-step-even-outside-a-test-case/11893/1 "2018-07-05T13:05:45Z")

</div>

Hi Katalon-Team,

please refer to my post at [How to forward Root Cause Message for Test Step Failure to Test Case Level? - #4 by Drunda\_Nibel - Web Testing - Katalon Community](http://forum.katalon.com/discussion/comment/18356/#Comment_18356)

Apparently there is currently no way in Katalon Studio to call a Test Case using WebUI.callTestCase() within a try block and to get the Root Cause message for the actual failing Test Step in the subsequent catch block. Or did we miss one?

But on the other hand, it doesn’t make sense to me to overload all my Test Cases  
with the logic for the necessary failure handling, if you imagine at the  
same time that Test Cases should also be able to be created and edited manually by  
non-programmers.

Therefore, I think it should be possible to implement this logic, what should happen with different kinds of errors, somewhere outside these Test Cases. Because depending on the requirements in a continuous integration process, this logic can be endless!

What I could imagine is either to extend the possibilities of the Test Listeners or to provide a globally available object that gives information about the Test Step that originally failed and why.

Do you see a way to make such functionality available in the future?

Regardless of that, I don’t want to miss to emphasize that I am enthusiastic about the unique combination of comfort and flexibility that Katalon Studio offers me!

Thank you very much! 🙂

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [July 5, 2018, 1:14pm UTC](https://forum.katalon.com/t/catch-root-cause-message-for-a-failed-test-step-even-outside-a-test-case/11893/2 "2018-07-05T13:14:48Z")

</div>

Upvoted

---

<div class="post-metadata">

**Author:** ![Mate\_Mrse](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mate_mrse/32/345_2.png) [@Mate\_Mrse](https://forum.katalon.com/u/Mate_Mrse)\
**Post date:** [July 6, 2018, 8:38am UTC](https://forum.katalon.com/t/catch-root-cause-message-for-a-failed-test-step-even-outside-a-test-case/11893/3 "2018-07-06T08:38:44Z")

</div>

Upvoted

---

<div class="post-metadata">

**Author:** ![Drunda\_Nibel](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@Drunda\_Nibel](https://forum.katalon.com/u/Drunda_Nibel)\
**Post date:** [January 25, 2019, 10:09am UTC](https://forum.katalon.com/t/catch-root-cause-message-for-a-failed-test-step-even-outside-a-test-case/11893/4 "2019-01-25T10:09:45Z")

</div>

Thanks to kazurayam’s ingenious preliminary work, I have now found a workaround, look here: [How to Highlight Test object in each and every step](http://forum.katalon.com/t/how-to-highlight-test-object-in-each-and-every-step/17408/26?u=drunda_nibel)

---

<div class="post-metadata">

**Author:** ![Drunda\_Nibel](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@Drunda\_Nibel](https://forum.katalon.com/u/Drunda_Nibel)\
**Post date:** [January 28, 2019, 8:38am UTC](https://forum.katalon.com/t/catch-root-cause-message-for-a-failed-test-step-even-outside-a-test-case/11893/5 "2019-01-28T08:38:48Z")

</div>

Just now, duyluong announced a change in the behavior of Katalon Studio, that callTestCase() only generates an error about its own failure, without revealing the root cause message of the child test case, for the next release:

> [@How to stop test case in catch block](http://forum.katalon.com/t/how-to-stop-test-case-in-catch-block/18291/12):
>
> 1. callTestCase will throw StepFailedException or StepErrorException if the child test case (callee) has errors.  
> Current: the parent test case (caller) always fails even users catch the right exception.  
> Next release: the parent test case should fail if users don’t catch the exception and should pass if uses catch the exception.
> 2. Yes. In next releases, users can get the root cause exception of StepFailedException or StepErrorException like the below example:
> 
> ```auto
> try {
> WebUI.callTestCase(findTestCase('Callee'), [:], FailureHandling.STOP_ON_FAILURE)
> } catch (StepFailedException e) {
> println e.getCause()
> }
> 
> ```
