When storing data in csv, can multiple data be extracted through a looping operation?

When storing data in csv, can multiple data be extracted through a looping operation?
I use the for function below to continuously issue new URLs.
Then, I want to save URsL in csv(by GlobalVariable.url)

Which part should I fix?

for (def row = 1; row <= findTestData(‘New’).getRowNumbers(); row++) {
WebUI.click(findTestObject(‘Page_SSCSVNumatcheck/input_SS_SSnum’))

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

WebUI.uploadFile(findTestObject('Object Repository/Page_SSCSVNumatcheck/input_SSCSV_csvFileSS'), findTestData('NEW').getValue(
        'c', row))

WebUI.waitForAlert(5)

WebUI.uploadFile(findTestObject('uploadObject/Page_SSCSVNumatcheck/input_CSV_csvFileNP'), findTestData('NEW').getValue(
        'd', row))

WebUI.waitForAlert(5)

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

//①From now new page will be open//

WebUI.waitForPageLoad(60)

WebUI.switchToWindowIndex(1 //switches to 2nd window
    )

secondUrl = WebUI.getUrl()

//②I acquire second page’s url //

GlobalVariable.url = WebUI.getUrl()

//③After I acquire second page’s url, Close second page //

WebUI.closeWindowIndex(1)

//④Turn to the First page(navigation), then loop ①~③ process //

WebUI.switchToWindowIndex(0)

}

‘Save the URL(from looping) to csv.’
File f = new File(‘./data1.csv’)

f.text = GlobalVariable.url

@kazurayam
You told me how to put the URL in Global Variable last time.

Now, let me know how to add multiple URLs to GlobalVariable and export them to csv.

You can cast a GlobalVariable object into java.util.List or java.util.Map, and add items into it. See

There is no built-in feature that enables you to export GlobalVariables into a file. You need to write a Groovy class/script to do it yourself.

Don’t you know how? Then you should start studying some good Java Programming book, for example

@kazurayam
Almost everything I want to build has been solved. It is true that your cooperation has been of great help. However, your attitude as a developer was very uncooperative and hurtful. The word “I Have Done, find your way” is so shocking that it cannot be forgotten. It felt like I asked any ridiculous question.

What qualifications do I need for someone to post on the katalon community? I think what I asked may be necessary information for someone else.

Yes, I thought it was a ridiculous question. I wondered why you do not make 2 or more GlobalVariables and save whatever data you want into them.

A few hours later, I changed my mind. I thought it is likely that you think that a GlobalVariable can only be a String or a Number. You possibly don’t know that a GlobalVariable can be a collection type (List or Map). Yes, it is a sort of tips that require some lesson. And unfortunately it requires explicit type casting (java.lang.Object -> java.util.List), which needs a careful programming effort. So I erased my previous post that said “I have done, find your way”; then posted 2 new ones as above.