How to download files to different desired locations at every iteration

Hi All,

We are trying to download the files for different scenarios at different path in windows folder, is there any ways to do it, if not how can we download the files automatically with unique names before getting saved in windows folder via Katalon script mode ?

It is possible to save the different paths to a List and then retrieve the file from the list.

List<String> list = ["c://temp//romeoNjuliet", "c://medical//occupationalTherapy", "c://happytime//blahblah"]
...
filename = list.get(cnt)

Another possibility is to use a “switch/case” block. You will have to use some indicator as your switch parameter and then a possible case id. I generally use this method because it seems best according to my conditions.
Groovy - Switch Statement (tutorialspoint.com)

Edit: Note you can “stack” several case statements together without a break to use one reference if you need. This is the part that I use for similarity within my testing. Additionally, you can have a default: case as a “for all the other” conditions.