Executing two method calls in a test case where one is run once and the other multiple times


I have a test case with two method calls, where I need to run the first method once and the second method multiple times. During those multiple runs the second method should pick different data rows from the data source.

The first method reads data from 1st source and should run only once, and the second method should loop through the 2nd source.

Any way to achieve this in Katalon? Please help.

For the second method to run multiple times, I used the following:


And then you use a variable in a loop to pick up the various rows (or columns):

// spreadsheet has a header row, so start on row 1
for (int row = 1; row < data.getRowNumbers(); row++) {
   col1 = data.getValue(1, row)
   col2 = data.getValue(2, row)

For the first method, perhaps you can do similar to above for one test case, then at the end of it, call the second test case that you set up with the above link. That way, each Test Case has its own spreadsheet to interact with.

Call test case | Katalon Docs
WebUI.callTestCase(findTestCase('TestCaseTwo'), ...)