Forum Discussion

plaidshirt's avatar
plaidshirt
Contributor
6 years ago

Get multiple values with Groovy script

I have a text file with lines of data. I would like to get multiple lines(values) from this text file in each iteration.

I have script, which uses one file in each iteration.

 

I store elements in a list.

 

List<String[]> myList = new ArrayList<String[]>();
while ((strLine = bufferedReader.readLine()) != null) {
  myList.add(strLine.split(","));
}

 

I get one file in each iteration from my list.

 

 

for(int i=0; i < myList.size(); i++) {
  element = myList[i];
}

 

I am not sure, how could I handle multiple values dinamically in each iteration. Should I create properties for each data?

 

1 Reply

  • Hi plaidshirt,

     

    Yes to store these values you need to have a physical location, for this you can use properties at any level,

     

    If these values are limited to Test-Step, then you can use Property Step, or else you can store values in Properties at different level.

     

    Do LIKE and ACCEPT if it help in your Query.

     

    Thanks and Regards,

    Himanshu Tayal