"I want to pass multiple JSON Payloads in one HTTP request" - JMeter doesn't restrict the number of "JSON Payloads" which you can send as the body in the HTTP Request sampler, moreover you are free to send absolutely anything. The question is whether the system you're testing is capable of parsing the "payloads", my expectation is that you're supposed  to send a *valid* JSON Object <https://www.w3schools.com/js/js_json_objects.asp> or (JSON Array <https://www.w3schools.com/js/js_json_arrays.asp>). We cannot help you without knowing the API contract of your encryption endpoint.

If you want to get the full response from the endpoint into a JMeter Variable and re-use it in next requests just add a Boundary Extractor as a child of the request which response you want to store and provide the desired variable name, i.e. *response*. You will be able to refer it as *${response}* later on where required. If you want not the full response but rather a specific part from it - take a look at JSON Extractor <https://www.blazemeter.com/blog/json-extractor> or JSON JMESPath Extractor <https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor>. Again we are not able to help without seeing the response and knowing which part of it you need to send

In case you're seeking for a piece of advice regarding how to generate and read JSON programmatically take a look at Parsing and producing JSON <https://groovy-lang.org/processing-json.html> article.

On 11/24/2022 11:25 AM, Smruti Koyande wrote:
Hello,

I want to pass multiple JSON Payloads in one HTTP request and use each of that responses in separate requests one by one.

Is any solution to achieve this? If any need to write a script then please guild me because I do not have much knowledge of coding

Ex.
I have one HTTP request (Encryption) which should accept multiple JSON Payloads and I want to reuse the response in the other 4 requests of the same thread group

image.png

Regards,
Smruti Koyande

Reply via email to