I use BeanShell Sampler
in JMeter
to list all the files from a folder. It lists files only from directory and unable to do the same in subdirectories
File folder = new File("C:\\_private\\Files\\input");
File[] files = folder.listFiles(new FileFilter() {
public boolean accept(File file) {
return file.isFile();
}
});
for (int i=0; i < files.length; i++) {
vars.put("file_" + i, files[i].getAbsolutePath());
}