Question

Copying ArrayList values to a Value List property in java step.

Hi,

I am having a requirement where i must copy items from an ArrayList into Clipboard property ValueList. This needs to be achieved in a java step.

Kindly, help me with this.

Thanks,

Bhargav

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Correct Answer
March 17, 2018 - 7:24pm

Here is a basic example of iterating through an array and adding the items to a value list property.

ClipboardProperty myProp = myStepPage.getProperty("TestList");

ArrayList<String> myArray = new ArrayList<String>();
myArray.add("North");
myArray.add("South");
myArray.add("East");
myArray.add("West");

for(int i = 0; i < myArray.size(); i++)
{
  myProp.add(myArray.get(i));
}

Comments

Keep up to date on this post and subscribe to comments

March 17, 2018 - 7:24pm

Here is a basic example of iterating through an array and adding the items to a value list property.

ClipboardProperty myProp = myStepPage.getProperty("TestList");

ArrayList<String> myArray = new ArrayList<String>();
myArray.add("North");
myArray.add("South");
myArray.add("East");
myArray.add("West");

for(int i = 0; i < myArray.size(); i++)
{
  myProp.add(myArray.get(i));
}

March 19, 2018 - 5:14am
Response to CarissaW_GCS

Hi Carissa,

Thank you for the response. I followed the procedure and was able to copy Array List values into Value List.

Thanks,

Bhargav