I have list of IDs in an ArrayList, Can anyone help me how to get the count of unique ID's from the list.
Assume the ArrayList
may contains:
ADD5C9
AA6F39
AA3D0D
AA48C9
8B9D48
63A859
ADD5C9
ADA162
AD9AD5
8B9D48
please find the code for the list
Thanks and Best Regards
Be aware that since JMeter 3.1 you should be using JSR223 Test Elements and Groovy language for scripting.
In Groovy it would be quite enough to call unique()
function for the ArrayList and it will remove all the duplicates:
def array = ['ADD5C9',
'AA6F39',
'AA3D0D',
'AA48C9',
'8B9D48',
'63A859',
'ADD5C9',
'ADA162',
'AD9AD5',
'8B9D48']
def unique = array.unique()
unique.each { value -> log.info(value) }
More information: Apache Groovy - Why and How You Should Use It