How to save spit values to one property
Hello,
please could someone help me with task below?
I would like to make data driven test where I use input excel file where i have colum Country in which can be one or more values separete with "," for this I would like to create groovy script in soapui which will parse this values and save it to property like
countriesProperty
<Country>UK</Contry>
<Contry>NL</Country>
in request will looks like
<CountryList>
${countriesProperty}
</CountryList>
Thank you in advance for any help.
Hi nick1 ,
Didn't understand the query fully, but as i have understood it, you have some data in excel with comma(,) seperated and you want to spit it with , and store it in properties step write. So, for that you can use below piece of code and update or enhance as per your need.
def data = "data,data1" // you can fetch this data from particular cell spiltData = data.split(",") for(def i=0;i<spiltData.size();i++){ testRunner.testCase.getTestStepByName("Properties").setPropertyValue("Prop"+i.toString(),spiltData[i]) }
Do let me know in case you need more help on this.