0

In the JSR Sampler I am assigning the value of a String I create i.e., SFDC_Prouct_1 in list. for e.g., list=SFDCProduct_5

Here SFDCProduct_5 is already a variable which has XML elements. Now I am trying to place a http request and in the payload I want to inject the value of SFDCProduct_5 . But I have to write ${list}, as list has the value of SFDCProduct_5 .

I tried ${${list}}, but thats not working.

Any ideas?

1
  • can you show more of your code so thatwe can help? Commented Sep 18, 2018 at 5:37

2 Answers 2

1

In JSR223 Sampler you can get the nested variable using vars.get

 vars.get(vars.get("list"));
Sign up to request clarification or add additional context in comments.

3 Comments

Thank you. :) I just used an extractor but will try this as well. This is more neat way.
Hi @user7294900. Like your dp. I observed most my questions are answered by you which are mostly correct. Do you work for stack overflow or just a user?
@Apu just a user, you can upvote my answer if it helped
0

If I correctly understood your question you need to wrap your ${list} into __eval() function like

${__eval(${list})}

Demo:

JMeter Evaluate Nested Variable

See Here’s What to Do to Combine Multiple JMeter Variables article for more information if needed.

1 Comment

Thank you. Will definitely try this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.