Comments in Properties Tab

How do you get comments to appear in the properties tab.

The guide (https://docs.katalon.com/katalon-studio/docs/toolbars-and-views.html#editors) says to use WebUI.comment(“My comment here”) but nothing shows.

Expected

As per the doco

image

Actual

** Build information **

image

Steps

Create test case with comments

image

But the comment field is always blank (and read only).

I’ve tried adding comments to the xml file behind the test case and that does nothing either.

Is this a bug or am I doing something wrong? I really want to use this function!

I have been a Katalon Studio user for years, but I have never been aware of “Comments in Properties Tab” of Test Cases.

I checked what you reported here on my side, and found it is easily reproducible.

c/c @ThanhTo

I suppose it is a bug, as the product is not behaving as documented.

I would recommend you not to expect this problem to be fixed soon. I don’t think this feature is used very much.

Agreed. I don’t see how it even could work. A WebUI.comment, like any line of code, is dependent on the execution thread(s) in the test case run. Storing those in a static field without any context makes no sense at all.

@mike.burns This is clearly a mistaken piece of documentation. Don’t hold your breath. I expect the docs to be “fixed” and the expectation/promise to be removed.

1 Like

The comments display in KS 7.5.2. If you look at your upper image, the Properties tab is the one on the right (beside the Integration tab).

image

image

Also interesting (but I don’t understand), I have a documenting comment at the end of my TestCase that also shows up in the Property tab. I have documenting comments throughout my program, but only the last one displays.

WebUI.delay(3)
"end of part 2"

image

Wow. that’s a long reach back.

That does make some sense I suppose. Except…

I use WebUI.comment everywhere. I see nothing in the Properties window, during or after a TC execution.

@ThanhTo - can we get some clarity on this please? The whole idea (as presented in the documentation) still makes no sense to me.

I also noticed that comments that are in conditional branches or loops do not display in the Properties tab.

And yeah, you won’t find me standing in line for the latest I… merchandise.

That explains it.

What a crazy idea anyway.

I found the problem. It is in com.kms.katalon.composer.testcase.parts.TestCasePropertiesPart

The code has changed since 7.5.2

  public void loadInput() {
    this.isInputLoaded = false;
    TestCaseEntity originalTestCase = this.parentPart.getOriginalTestCase();
    TestCaseEntity testCase = this.parentPart.getTestCase();
...
    populateTxtFieldValue(this.txtDescription, testCase.getDescription());
    populateTxtFieldValue(this.txtComment, **getComments()**);
    this.isInputLoaded = true;
  }
  
  private String getComments() {
    if (this.parentPart.getChildTestCasePart() != null)
      return StringUtils.join(this.parentPart.getChildTestCasePart().getCommentSteps(), "\n"); 
    return "";
  }

But in 8.1.0

public void loadInput() {
this.isInputLoaded = false;
TestCaseEntity originalTestCase = this.parentPart.getOriginalTestCase();
TestCaseEntity testCase = this.parentPart.getTestCase();

populateTxtFieldValue(this.txtDescription, testCase.getDescription());
populateTxtFieldValue(this.txtComment, testCase.getComment());
this.isInputLoaded = true;
}

getComments() still exists but is not called.

And within the Test Case Entity the comment is a simple read/write - but it never gets written to so is always empty string.

public class TestCaseEntity extends IntegratedFileEntity {

private String comment = "";

public String getComment() {
   return this.comment;

}

public void setComment(String comment) {
    this.comment = comment;
}

}

@mike.burns

How did you get access to the source of the com.kms.katalon.composer.testcase.parts.TestCasePropertiesPart ?

As far as I know, the source code of Katalon Studio is NOT open-sourced; only a limited portion is made publicly visible at https://github.com/katalon-studio/katalon-studio-testing-framework/tree/master/Include/scripts/groovy/com/kms/katalon I did not find the TestCasePropertiesPart there. Are you an insider of Katalon?