How to write the result data into CSV and reuse it in next testcase

Hi Community,

I have test cases to perform CRUD operations on job. I’m using CSV file for test data required to create job test case. I need to store the jobname and data created values into CSV file then use them in the next testcases for update, delete.

How can I write the required values into CSV file and use them in the consecutive testcases?

TC1:

File data = new File("./data.csv")

// write CSV into a file
data.text = 
"""aaa,bbb,ccc
ddd,eee,fff
ggg,hhh,iii"""

TC2:

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

File data = new File("./data.csv")

// read a file
String content = data.text

println "TC2: s=\n" + content

I created Test Suite which binds TC1 + TC2.

I executed the Test Suite, saw the following output in the console:

...
TC2: s=
aaa,bbb,ccc
ddd,eee,fff
ggg,hhh,iii
...