I have defined a list variable in the global variable section in Katalon studio, I want to retrieve the count of the list item and select any random value from it .
I have around 25 values,
Please try the below code:
def patientName = []
patientName = GlobalVariable.patientList
int length = patientName.size()
println "---->"+ length
int min = 0;
int max = length-1;
int random_int = (int)Math.floor(Math.random()*(max-min+1)+min);
def patientRetrieve = patientName[random_int]
println "---->"+ patientRetrieve