Reputation: 31
I am facing problem while using a variable inside another variable name for example check this : ${email_${count}} .
Here email is the variable name storing data from JDBC request sampler and as you might know data into variables gets stored like this : email_1 , email_2 and so on based on the rows we are extracting.
Now i don't want to write 10 variables manually like email_1 , email_2 , email_3 upto email_10 . i am using counter from 1 to 10 and counter reference variable name is count so my syntax is becoming as : ${email_${count}} . where email would be the variable from JDBC sampler and count is counter variable name . Basically i am appending counter variable to JDBC variable , but jmeter is treating it as a standalone variable .
Can anyone please help me in this matter. if you need further clarification let me know.
I am attaching screenshots below for more clarification.
Upvotes: 2
Views: 295
Reputation: 58772
Use __V function for evaluating variable inside a variable
${__V(A${N})} - works OK. A${N} becomes A1, and the __V function returns the value of A1
You should use it in your case:
${__V(email_${count})}
Or use __evalVar with similar syntax:
${__evalVar(email_${count})}
The evalVar function returns the result of evaluating an expression stored in a variable.
Upvotes: 2