0

In J meter I have 2 Thread from Ist thread I am getting token value and I have to use that into 2nd thread header manager. The value generated is in JSON so, I have used JSON extractor to extract the value of that token but I am not able to use that value into Next(2nd Thread)

Thread 1: JSON extractor I have used $..token to extract my token value and stored into a variable 'X' as in JSON Extractor there are one field names of created variables.

Thread 2: Header manager -->> I want to use that value with one word 'YY' so it should be like 'YY (token value)'

For the above one I have tried YY+{X} it's not working for me and also YY {X} it is also not working.

SO kindly help me in this.

3
  • Try using YY ${X}. Commented Apr 1, 2019 at 6:51
  • its Not working @Adnan Commented Apr 1, 2019 at 7:26
  • Provide your full response and mark what to extract Commented Apr 1, 2019 at 8:17

1 Answer 1

1

First at all, ensure you're running your threads consecutively (Check 'Run Threads Consecutively' in Test Plan properties)

Easiest way to share variables between threads is to use 'Properties', In your example after you have extracted the variable 'X' create an assertion or post processor of your preference(i use beanshell assertion), and copy this: ${__setProperty(paramToAnotherThread,${X})}.

Then in the other thread use ${__property(paramToAnotherThread)} to invoque it.

Hope it works.

Here you can see explained: https://www.blazemeter.com/blog/knit-one-pearl-two-how-use-variables-different-thread-groups

Sign up to request clarification or add additional context in comments.

Comments

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.