Debugger stops on line 'fos' even though breakpoint is not set there

log.zip (4.3 KB)

Attempting to debug code and step through breakpoints. Script stops even though breakpoint is not set. See screenshot for file and line number. This is impacting my work because this line of code is called often and I can’t get past this line to get to my code I want to debug.

Please let us know what you are using Katalon Studio for?

–> 3. I have currently applied Katalon Studio in my project

How would your work be affected if this issue has not been resolved?

  1. I cannot continue my job and have to work on something else while awaiting your response
    I can’t continue because I cannot debug at all.

Operating System

Windows 10

Katalon Studio Version

7.8.1

Katalon Studio logs

  • Windows logs folder: \config.metadata.log is attached

Screenshots / Videos

line#101 fos.close() statement is throwing NullPointerException.
スクリーンショット 2020-12-12 8.24.53

This means that the variable fos is left being null at fos.close().

FileOutputStream fos = null
try {
    ...
    fos = new FileOutputStream(file)
    ...
} catch (IOException | NullPointerException e) {}
} finally {
    try {
        fos.close()
    }
}

Something went wrong (I don’t know what) inside the try { ... }. Possibly some type of Exception, other than IOException and NullPointerException, was raised. Then the flow would skip catch() clause and reach to finally clause. In this case, fos may be left null.

How to investigate? Why not you change the code slightly to get StackTrace printed where you would find more info.

} catch (Exception e) {
    e.printStackTrace()
}

I removed existing Katalon directory and installed latest version and I am unable to recreate the error.
Thank you for the help.

@jim.sears

In this topic you reported a problem in com.kms.katalon.core.execution.TestExecutionSocketServerEndpoint.

In another post "No application is started yet" shows in Web Testing @shunmatsu_begginer reported a problem in the com.kms.katalon.core.execution.TestExecutionSocketServerEndpoint as well. @duyluong replied at "No application is started yet" shows in Web Testing that Katalon Team confirmed a bug and will fix it in next release. You may wait for their work.

@duyluong
Any comment?


@jim.sears

You wrote

I tried to modify the try/catch in Katalon but I don’t have read/write access to that code in TestExecutionSocketServerEndpoint. Should I try to modify this class elsewhere?

Do you want to modify TestExecutionSocketServerEndpoint for further investigation for yourself?

You can try do it by Groovy’s Metaprogramming feature. You can overwrite the run method implementation of the class with your code. Learn the official document:

http://groovy-lang.org/metaprogramming.html#metaprogramming_emc

Here is a sample project where I used the Metaprogramming feature in Katalon Studio.

You may be or may not be successful in overwriting the class and change its runtime behavior. I do not know. Just try and see.

However, even if you worked out in Metaprogramming, I suppose you would not be able to fix the root cause and consequently you can not use the Debugger in your project. You had better sit tight, wait for the Team to release the fix.

@jim.sears,

This is an issue that relates to TimeCapsule feature. The fix will come in v7.8.2.

Thanks for your report.

@kazurayam,

@duyluong replied at “No application is started yet” shows in Web Testing that Katalon Team confirmed a bug and will fix it in next release. You may wait for their work.

This is a different issue with the one you mention.

@kazurayam and @duyluong

Issue resolved with v7.8.2
Tried debugging with and without TimeCapsule enabled. All good!

1 Like