Forum Discussion

nick1's avatar
nick1
New Contributor
6 years ago

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 separ...
  • HimanshuTayal's avatar
    6 years ago

    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.