Limbo
Limbo

Reputation: 663

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.

Upvotes: 1

Views: 1844

Answers (2)

Dmitri T
Dmitri T

Reputation: 168157

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:

Upvotes: 1

ararar
ararar

Reputation: 983

First of all, create a CSV file with all the name of files you want to upload, the name of the files in the CSV file should include the file extension. i.eMy_File.csv.

Add a CSV data set config prior to your sampler.

And finally replace the file path (under files upload tab) to your sampler with the variable name from your CSV data set config.

Upvotes: 0

Related Questions