0

I want to pass Json object dynamically as HTTP post request's payload in JMeter. object's is in Json format in a Json file. e.g:

{"id":"1","Title":"Shirt"}, {"id":"2","Title":"T-Shirt"}, {"id":"3","Title":"Pant"}, ]``` my goal is to pass different object every time in HTTP request. I tried it to add a file request to read the payloads from Json file dynamically and pass it through my HTTP request which is under load test. it works fine in local machine but when i execute test in azure load test the file read request is failed and then of-course the actual HTTP request which is under test will be failed. read payload:[![enter image description here](https://i.sstatic.net/5UBphHOp.png)](https://i.sstatic.net/5UBphHOp.png) Https request(under test):[![enter image description here](https://i.sstatic.net/QiAFYanZ.png)](https://i.sstatic.net/QiAFYanZ.png) 

1 Answer 1

0

There is API endpoint for uploading test files, you need to upload the file first and then reference it in your script.

Also if you want to pass the contents of the file fully as it is - it would be easier to use __FileToString() function.

In other cases you can go for CSV Data Set Config, see Update your JMeter script to read CSV data and JMeter Parameterization: The Complete Guide articles for more details.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.