0

I need to send "id" from response to the next request in URL (like - - send/request/"id"). How do it right?

  1. Response https://joxi.ru/1A5374vhDENjXm
  2. Regular Expression Extractor https://joxi.ru/KAxv8ONUZL7lgm
  3. Send "id" in URL https://joxi.ru/52aaP4EIExO702

2 Answers 2

0

You have to use the variable you've created on the JSON Extractor:

${study_id}

enter image description here

Below you are using simply Id

enter image description here

More info on JMeter variables here.

You regex is also wrong, try "id":(\d+). This will capture on the first group any integer that follows the the id string.

But I would suggest to replace the Regular Expression Extractor for a JSON Extractor.

With this, you just need to indicate the JSON key that you are looking for.

enter image description here

In your case, $.id.

5
  • it does not help, joxi.ru/D2PxPWGtqX77j2,
    – Dmitry_Mir
    Jul 18, 2019 at 10:28
  • 1
    My bad, it should be ${study_id}. I've updated the answer and linked a blog post where I give more details. Can you try this out? Jul 18, 2019 at 10:35
  • I tried but it doesn't work joxi.ru/vAWJP0vCgEY6j2
    – Dmitry_Mir
    Jul 18, 2019 at 11:04
  • There were some problems on the extraction as well. Could you check my new edit? Jul 18, 2019 at 11:19
  • It's working, very grateful for the help!!!
    – Dmitry_Mir
    Jul 18, 2019 at 12:33
0

I hope you know the Parameterization and Correlation concept in JMeter, so in this if we want to pass one value throughout the script then pass the variable name within dollar($) and curly braces'{..}' like this

${variable_name}

In your case here https://joxi.net/KAxv8ONUZL7lgm, the variable name is written in the field 'Name of created variable' i.e 'study_id'

Also, If you want to check whether the variable's value is null or not then use Debug Sampler either at the end of script or place it where the variable is used in the request.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.