Search code examples
jmeterload-testingjmeter-plugins

how to post http request with file upload several times with different file each time Jmeter


I have the following request, with file upload without "multipart/form-data for POST" that is working perfect. enter image description here

now I want to run this for several users lets say 5 or 10 but each time with a different file (like taking the file from parameter or csv file or something like this).

couldn't find a way of doing it except of making different samplers each one with a different file, but for let say 1000 files this will be a lot of work.


Solution

  • Just replace hard-coded File Path with a JMeter Variable like: ${filePath}

    JMeter FilePath variable

    Depending on where do you get your file names or paths from this ${filePath} variable can be populated from: