The last designated file is continuously downloaded

I use the previously written automatic download script to save the download file list (excel file), and then download one file per line through the loop script. (Column a, column b value in search bar)
However, in recent years, errors have frequently occurred in which the last designated file is continuously downloaded.
Please let me know if there is a way to prevent duplicate files (last row in last column a and b of Axel) from being specified at the end.
Here is the script

for (def row = 1; row <= findTestData('New').getRowNumbers(); row++) {
    WebUI.setText(findTestObject('Object Repository/Page_SSCSVNumatcheck/input_ID_f_camp_id'), findTestData('NEW').getValue(
            'a', row))

    WebUI.click(findTestObject('Object Repository/Page_SSCSVNumatcheck/input'))

    WebUI.click(findTestObject('Object Repository/Page_SSCSVNumatcheck/input__checkAllButton'))

    WebUI.click(findTestObject('Page_SSCSVNumatcheck/input - download'))

    WebUI.waitForAlert(5)

    WebUI.setText(findTestObject('Object Repository/Page_SSCSVNumatcheck/input_ID_f_camp_id'), findTestData('NEW').getValue(
            'b', row))

    WebUI.click(findTestObject('Object Repository/Page_SSCSVNumatcheck/input'))

    WebUI.click(findTestObject('Object Repository/Page_SSCSVNumatcheck/input__checkAllButton'))

    WebUI.click(findTestObject('Page_SSCSVNumatcheck/input - download'))

    'From now, move to Upload Test Cases'
    WebUI.waitForAlert(5)
}

(Updated formatting to make the script clearer)

My guess at what happened here is that the excel spreadsheet you are parsing has since been saved with a large number of “empty” rows. Then, when you call findTestData('New').getRowNumbers() in your looping conditions, it’s actually continuing past the “last” row (the one which actually has data).

As a test, try copying all of the rows which have actual data into a new workbook and/or sheet, and rerun with this workbook.

@Brandon_Hein
I found the reason why duplicate data is downloaded when I run the katalon test.
There’s probably a number on the line ‘No.’ in Katalon’s Data files.(Even though it’s blank)
When I checked the actual Excel file sheet, most of them were blank. Please let me know if you have a solution to a problem like this.