I understand that the CSV Data Set Config cannot use JMeter Variable as the "Filename", so I used the __property function as suggested in different posts:
- I defined an initial variable (datapoolpath) in the "User Defined Variable" config element
- I then converted my 'datapoolpath' variable in a property 'pdatapoolpath' in a BeanShell PreProcessor
- I used the ${__P(pdatapoolpath)} in the Filename field for the CSV Data Set Config
This workaround runs fine when I run the mytest with the Jmeter GUI. As soon as I try to run the same test via cli (jmeter -n -t mytest,jmx -Jdatapool=c:\datapool), then it doesn't work anymore (ie: the csv data config is not able to find the csv file, since the property "pdatapoolpath" value is null. Please note, that in my BeanShell script I use to print the property's value, and still it seems to be correctly printed.
So my question is: where am I wrong? why jmeter behaves differently when run from GUI vs CLI?
thanks in advance