Define array to be printed in webelement

Hi Team.I have some common data to be filled up but the ID should be different for each of them. How can I define array that contains all the IDs ex. ID1,ID2,ID3… and want to circulate a loop that prints all the values.

I define array as,
def myarray=[“ID1”,“ID2”,“ID3”]

then apply a for loop where I keep my ID webelement as below

for(int i=0;i<3;i++)
WebUI.setText(findTestObject(‘require risk master/Test strategy/Page_Validator/input_Test strategy ID’), ‘myarray[i]’)

I know I made some mistake to define array and locate to a web element. Pls guide me.

Why is myarray in quotes?

@Russ_Thomas Without quote it show me error so I keep it. It prints myarray[i] in the box but I want ID1,ID2… I am beginner and really don’t know how can I setup array. Pls make me correct and guide me.

But it’s wrong.

What is the error you get when you remove the quotes?

@Russ_Thomas. Thanks it is working for me when remove quotes. may be that error is indicating something else and I understand it elsewhere.