One day in my “VisualTestingInKatalonStudio” project when I run a test case, I got the following message :
2019-05-25 12:33:09.582 ERROR c.k.k.core.context.internal.TestHooker - ❌ java.lang.IllegalArgumentException: reportsDir is expected to have dir name 'Reports' but not: /Users/urayamakazuaki/katalon-workspace/VisualTestingInKatalonStudio/Storage
com.kms.katalon.context.internal.TestHooker#invokeMethod()
caught an IllegalArgumentException thrown by some of my custom classes.
I wanted to know which class, which method threw this IllegalArgumentException, and wanted to read the stack trace to seek for the root cause of the problem. But TestHooker did not show the most valuable stack trace. Without the stack trace, it was very hard to debug my problem. I got irritated.
I want TestHooker to print the full stack trace of Exceptions thrown by custom classes from inside test cases.
I have an idea how to change TestHooker, near line#135:
Now:
} catch (Throwable e) {
logger.logError(ExceptionsUtil.getMessageForThrowable(e));
Modified
} catch (Throwable e) {
logger.logError(ExceptionsUtil.getStackTraceForThrowable(e));