Brarord
Brarord

Reputation: 651

How to send huge JSON from body inside request? Jmeter

I want to test request which is sending JSON using body. How it looks in DevTools:
enter image description here

So i am clicking "view source" and i am coping whole that code.
Next stage is to paste that code into "Body Data" in my HTTP Request (JMeter). After 15 minutes of waiting i am able to see that result:
enter image description here

but JMeter is frozen as f... I have huge lag. This JSON is to much for this.
How can i paste something like that without this lag?

When i am trying to paste coded version it is pasted without lags. But as i can see coded version do not work :( i need to paste that json from "view source"

Upvotes: 5

Views: 5982

Answers (1)

Dmitri T
Dmitri T

Reputation: 168197

You can save the JSON into a file like payload.json and store this file in "bin" folder of your JMeter installation.

Once done you can load the file in JMeter script via __FileToString() function like:

${__FileToString(payload.json,,)}

enter image description here

This way you will be able to manage your script easier.


Going forward you can optimize even more via HTTP Raw Request sampler which has nice feature of directly streaming the file to the endpoint without loading it into memory first, check out HTTP Raw Request for SOAP + MTOM discussion for more information.

Upvotes: 10

Related Questions