I try to Loop scenario for 2 times fetching data from array.
My use case is: I want to create user, for multiple countries, so instead of coping the case, I want to implement loop logic.
So far a tried like, but without success:
- from here I want to fetch data
//JSR223 PreProcessor
String[] varArray = {"US", "UK"};
idx = Integer.parseInt(vars.get("loopCounter"))-1;
vars.put("myVariable", varArray[idx]);
Whole script, which is chain of multiple API calls, and i want to use fetch data, only a single call.
Result:
I got null, if I try to use fetch variable.
Script37.groovy: 1: unexpected token: US @ line 1, column 22.
String[] varArray = {"US", "UK"};





