1
votes

Based on this thread: Jmeter - Using varible: from JDBC request into another JDBC query under loop

I tried to get variable from DB query and use it.

If i use into parameter value like: ${__V(id_${__intSum(${__jm__Loop Controller__idx},1,)},)} inside loop controller works perfectly fine.

enter image description here

But, if i want to use in JSR223 PostProcessor like:

def dbID = '${__V(id_${__intSum(${__jm__Loop Controller__idx},1,)},)}'
log.warn(dbID);

or

def dbID = prop.getObject("id").get(i).get("id")
log.warn(dbID);

My script fails.

What is the equivalent usage of ${__V(id_${__intSum(${__jm__Loop Controller__idx},1,)},)} into JSR223 PostProcessor?

My script:

enter image description here

1

1 Answers

1
votes

Use vars:

 int id = Integer.parseInt(vars.get("__jm__Loop Controller__idx"))+1;
 vars.get("id_"+ id);