Do you mean you want to increment the “Default value” of “variable” from 0 to 1 by script?
I have an idea how to implement it, but it is not a good approach.
However I would tell you the straight forward scenario how to. The content of Variable tab of a “New Test Case” is serialised into an XML file at the path of “
projectDir/Test Cases/New Test Case.tc”, which looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<name>New Test Case</name>
Here you can find an XML element
This is the serialized format of a Default value of a variable
foo of the Test Case.
You might be able to write a Test Case script to edit this XML file. I guess, Katalon Studio does not prohibit you from doing so.
Let me suppose you have developed that Test Case script. Every time you executed it and edited the XML file, you have to close the project and reopen it. This is to let Katalon Studio reload the edited XML file.
I do not think that this approach is good.
If you are capable of Groovy programming, you should be able to write a script that makes a text file in the project directory, and update it. The script will create a file, for example
projectDir/history.json, with the initial state
Once your test has run, the file should be updated to:
Next time it should be updated to:
and so on.
Your test case script needs to be capable of entirely managing (create/read/write/delete) the file. Skill of Groovy programming is required here.
I have no other idea easier to implement.