Variable value in test case description

So we are following the Data-Driven Testing example here (https://www.katalon.com/resources-center/tutorials/data-driven-testing/) and have it all working great. But we’d like to have the values of the test case variables be part of a test case’s description. That way, when the Test Suite runs the test case three times, the different binded variable values will be part of the test report’s output.

Is this possible?

1 Like

Mark,

We cannot change the test case name by a script for reporting purpose. A possible solution I could think about is creating “After Test Case” listener, where we can catch the test case information, and use its information to update the report, ie: string = testcase.getname() + some-text

Did you ever get this working? I’d like to know how to do it too, if it’s possible

No, we never found a way to set the test case description to a new value, only get the existing one. Which is a shame as this would be really handy.

This is possible, but not AFAIK by using Katalon’s native reports facility. To get fully customizable reports, I had to write my own…

1 Like

Then it is no way to named test step dynamically? :open_mouth:

Yes, there is, but not by using standard Katalon APIs. Like I said above, you can write your own reporting code but this not trivial task.

Read my response here if you want to know the kind of coding expected of you:

@Trong_Bui trying to understand string = testcase.getname() + some-text, Can you give me bit more information?

Here is the after test cases listener. There is no TestCase object there is only TestCaseContext. Which does not have the option to modify the name.,

@AfterTestCase
	def sampleAfterTestCase(TestCaseContext testCaseContext) {
		println testCaseContext.getTestCaseId()
		println testCaseContext.getTestCaseStatus()
	}