Reputation: 75
I'm facing problem how to configure path fo CSV file in SetUp thread group in Blazemeter.
Purpose of this script is a to load names, last names, address, each of this has its own file. In Setup thread files a read and combinations of names, last names and address is used to create different users. Each row is saved in variables 'Name_##', Lastname_##', and randomly chosen in preprocesor BeanShell script to create a random real name user. The script was test on a local environment and works correct.
Before importing script to Blazemeter a have change location of the file it is only a name of the file. Into Blazemeter was imported all needed CVS files and jmx file.
Blazemeter return error: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``log.info("Start reading file!"); var folder = vars.get("CurrentDir"); log.inf . . . '' : Typed variable declaration : Object constructor
it failed in the line 'BufferedReader reader =' because it did not able to locate a file. I have alo detect when investigating on local environment.
Script failed because the file location was incorrect.
How Jmeter setup thread is reading files. This is example of one file:
var folder = vars.get("CurrentDir");
log.info("currentdir = " + folder); //CurrentDir = c:\data\
BufferedReader reader = new BufferedReader(new FileReader(folder+"Names1.txt"));
I don't want to use Sampler 'CVS Data Set Config' because limits a combinations of existing combinations. How should i configure path to 'CSV files' that data will be read from Beanshell processor in Blazemeter?
Thanks for answers.
Upvotes: 0
Views: 341
Reputation: 1999
Upload the required files to blazemeter and then use the relative path:-
Defining the path to files in Shared Folders in your JMX:-
To point to a file from an included Shared Folder in your script, simply use the "folder/filename" style path: folder1/file11.csv (no leading slash).
Please check the below link for more details:-
https://guide.blazemeter.com/hc/en-us/articles/207420175-Uploading-Files-Shared-Folders
Hope this helps.
Upvotes: 1