Any possibility to get the boolean value of the condition while debugging

When debugging the code if there is “IF” condition how can we get the return value of the “IF” condition while debugging?

debugingOption_KatalonStudio.png

Hi,

you can create boolean variable and assign a result of equals() method before IF. Then, use this variable in IF statement and you’ll see if true/false is assigned.

The debugger is notoriously poor at allowing you to evaluate code in the Expressions window (it’s not even very good at evaluating the value of variables most of the time. If you’re really stuck at this point, you can use a comment to get you further along…

Use a comment to print the evaluation of the condition:

boolean result = subMenuItem == null
WebUI.comment("The result is: " + result.toString())

If you place a breakpoint on the second line, you could also examine result in debugger.

Marek Melocik said:

Hi,

you can create boolean variable and assign a result of equals() method before IF. Then, use this variable in IF statement and you’ll see if true/false is assigned.

Hi,
Thank you very much for guidance.

Russ Thomas said:

The debugger is notoriously poor at allowing you to evaluate code in the Expressions window (it’s not even very good at evaluating the value of variables most of the time. If you’re really stuck at this point, you can use a comment to get you further along…

Use a comment to print the evaluation of the condition:

boolean result = subMenuItem == null

WebUI.comment("The result is: " + result.toString())


  
If you place a breakpoint on the second line, you could also examine result in debugger.  

  

Hi,
Thanks for the guidance. I was expecting option like "Inspect | Ctrl+Shift+I " option on eclipse. anyway now I have two workarounds to get the results.