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

Hi,

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:

https://mundrisoft.com/tech-bytes/read-data-from-excel-sheet-using-katalon-studio/#:~:text=In%20this%20article%20will%20see%20how%20to%20use,Provide%20Test%20Data%20Name%20in%20“Name”%20Text%20box.

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'), ...)