0
votes

How can I provide multiple folders using bean shell pre processor to read files using jmter thread?

I tried to upload multiple files using bean Pre processor and Http request sampler sending all files present is folder provded for one thread.

If I do have different folders for different thread it is requred to provide dynamic path/parameterized path for bean pre processer.

I want to make dynamic path for 'path_to_your_folder'

bean shell pre processor configuration: Bean Shell pre processor configuration image as below

1

1 Answers

0
votes

You can parameterize file path using CSV data set config and use the parameter in your beanshell..

Create a CSV file containing all paths. Add a CSV Data Set Config to your test plan and configure your CSV ,give variable name as shown below

enter image description here

In your pre-processor you can use vars.get("Variablename") to get file path as shown below enter image description here

For more info on beanshell please read this article.

however its recommended to use JSR223 sampler with groovy as the performance is much better compared to beanshell.. Please let me know if it helps