Reputation: 454
I will have n (not fixed number of files) number of csv files, and these files should be passed as input to http sampler request. The plan is that all the threads should read the data from csv file1 and file2... till file n. There should not be any duplicate data read for any of the thread.
currently i have the jmeter script to read the data from 1 csv file and it is working fine, So same has to be extended to read the data from multiple csv files.
Upvotes: 0
Views: 219
Reputation: 168147
I believe the easiest solution would be combining all the multiple CSV files into one prior main logic of your test begins.
Put the following code into "Script" area:
def combined = new File('combined.csv')
combined.text = ''
combined.withWriter { writer ->
new File('/path/to/folder/with/your/CSV/files').listFiles().each { file ->
file.withReader { reader ->
writer << reader << System.getProperty('line.separator')
}
}
}
Configure the CSV Data Set Config to use combined.csv
filet
Upvotes: 1
Reputation: 414
Use Directory Listing Config plugin. Please go through the below link.
https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/directory-listing/DirectoryListing.md
There are other methods as well for iteration multiple files in jmeter, but this would be the easiest way to do it.
Upvotes: 0