Vegetation load testing: different bodies for each POST request in the attack

Is there a way to change the json body in vegetation request load tests in vegetation.

I want to send a request with a different parameter to the json body for each of the requests. for example if i have

POST https://endpoint.com/createNew
@/targets/data.json

      

and data.json looks like

{
   "id": 1234
}

      

What is the best way to do this so that we have different request data for each of the requests in the attack?

+3


source to share


1 answer


If you have multiple files in a folder targets

and would like to use them in test boot mode, I would suggest the following configuration:



  • Install Config Directory List Plugin Using JMeter Plugin Manager

    Setting JMeter Directory List Configuration

  • Configure it to point to the folder targets

    :

    List of directories Config - configuration

  • In the HTTP request, Sampler uses __ FileToString () , like:

    ${__FileToString(${filename},,)}
    
          

    Using a file in the request body

  • When you run your test, it will pick up the next file from the directory targets

    and use its contents as the request body

    JMeter Directory Listing Config in Action

0


source







All Articles