Search code examples
jsoniojmeter

Send Multiple JSON Files from Directory to a REST API with JMETER


I'm really struggling with getting Jmeter to work with sending multiple json files in Jmeter to a REST API. I have tried other questions on stack and tutorials online and none of them answer my specific requirement.

My requirement is that I will have various json messages saved to a file directory and I'm trying to use JMeter to loop through the folder, pick up the json's and pop it into a HTTP request one at a time i.e. one file = one request and view the result.

Does any one know how to do this?


Solution

  • The easiest solution would be:

    1. Directory Listing Config plugin to read file names into a JMeter Variable

      enter image description here

    2. __FileToString() function to read the file content

      enter image description here