Variables at test case level

I think you might be reading more into it than is actually there.

Test Cases are Groovy Script classes where the TC becomes the “body” of the run() method.

ClassName.'dynamic.method.name'() is a standard part of the language.

1 Like

Once I wrote:

I found a super silly mistake in my code.

Wrong:

String ProductName2 = "$ProductNamePrefx $formattedDate"

Correct:

String ProductName2 = "$ProductNamePrefix $formattedDate"

i was absent. This typo made me foolish.

1 Like

@kazurayam :smiley:

@Russ_Thomas btw, i forgot. In your setup you don’t show katalon version, let’s asume are using ‘latest’ …

Well, 7.x was mentioned, though nothing specific.

This was a 7.2.4 release.

Either way, @Jaspreet.mangat seems to have gone quiet.

1 Like

7.6.2 - same result.

1 Like

@Russ_Thomas now, i think we can consider we have a clear picture …
Gg, always a pleasure to challange you in debugging!

1 Like

Actually ,it works with quotes without the plus sign . if you see the below screen shot , It worked with quotes" without +


Sorry, yesterday did not get time to look into this.
Actually , I mentioned in a earlier post ,that it worked for me. ProductNamePrefix is declared at test variable level.

String ProductName = “$ProductNamePrefix $formattedDate”

println("$ProductName")

Starting with robotframework 2.7 there is a built-in keyword named Set test documentation, which can be used to replace or append to the existing documentation. This will not affect the output in the console, but the changes will be reflected in the log and report.

For example:

| Variables |
| ${SystemUnderTest} = | Staging

| testcase |
| Device Test |
| | Set Test Variable | ${device} | iPhone
| | [Documentation] | Device is: ${device} |
| | … | System is: ${SystemUnderTest} |
| | Substitute vars in documentation
| | No Operation

| Keywords |
| Substitute vars in documentation
| | ${doc}= | replace variables | ${test documentation}
| | set test documentation | ${doc}