How to hide Exceptions in the final Report?

Hello,

I’m testing an API on Katalon Studio. I’ve written a few assertions in my script, and they are working, however, anytime an assertion is false, an Exception is throw, the test is interrupted and the report is
generated looking like this:

How can the red square content be hidden from the user in the report? I wanna show just the assertion message in the report (which I defined in the script), not the authomatic Exception message.

Below you can find my script, it was the closest solution I’ve found so far to meet my needs.

Note: This is my first time doing API tests and therefore using Katalon Studio. Please be patient :sweat_smile:

Thank you in advance!

1 Like

You should read the Exception in the report.

The stacktrace you shared includes the following lines:

image

This tells us that your “Failed Cases” script calls sendRequestAndVerify keyword at the line#20. The keyword found an error and printed the StackTrace. Therefore you should review the “Failed Cases” script if you want to fix the problem.

In the above post, you shared the source of def validateResponse function. But I think that the function possibly has nothing to do with the stacktrace printed in the final Report.

Then you should use sendRequest keyword, rather than sendRequestAndVerify keyword, so that your Failed Cases script won’t verify the respose at all. The sendRequest keyword won’t print the stackstrace which was emited by the sendRequestAndVerify keyword.

However, I don’t think it is a good idea.

I mean, the sendRequestAndVerify found something seriously wrong in the HTTP response. For example, Web Server might have returned a NON-JSON response = an HTML that says “Internal Server Error”. I guess that you haven’t looked at the error and investigated it yet. If you hide the Exception in the report, you would miss the chance to solve your problem. You should fix the reported issue(s) one by one. Once you fixed the problem, then you wouldn’t see the stacktrace printed any longer; that is what you should really achieve.