I'm extracting 2 two set of values in two different lists from a JSON response using JSON extractor
I'm looping through values of list1 using a foreach loop, so i can easily get values from list1 one-by-one:
But I want to send values from list2 in one of the request inside this foreach loop. How can I get values from list2 one-by-one so that I send it as a parameter:
This HTTP request will be called for each item in list. I want to add value from list2 to lastUpdated parameter in given HTTP request.How can I do it?
I did some research and got to know that we can use Beanshell PreProcessor for this task. I added following code in Beanshell PreProcessor:
idx = Integer.parseInt(vars.get("item_no"))-1;
vars.put("date", vars.get("list2")[idx]);
And tried passing date as follows:
{"qId":"${q_oid}","items":[{"itemId":"${qi_id}","lastUpdated":"${date}"}]}
But I'm getting blank in the lastUpdated arg.
Note : I have added 'date' in the user defined variables of the test plan



