CSV Config Relative path

2,336 views
Skip to first unread message

jack...@gmail.com

unread,
Dec 17, 2014, 11:08:45 AM12/17/14
to jmeter-...@googlegroups.com
Is it possible to set up CSV file to load settings from a relative path?  I want to configure multiple JSX files to read the common settings from one file but I don't want to hard code the path in the jmx file.  Is it possible to do this?

Cheers,
Jack

Jack Allan

unread,
Dec 17, 2014, 11:13:15 AM12/17/14
to jmeter-...@googlegroups.com
I should mention that I want it to be relative to the jmx file not to the jmeter/bin folder.



--
You received this message because you are subscribed to a topic in the Google Groups "jmeter-plugins" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jmeter-plugins/m2iU3lEtT04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jmeter-plugin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jack...@gmail.com

unread,
Dec 17, 2014, 11:25:48 AM12/17/14
to jmeter-...@googlegroups.com, jack...@gmail.com
I should ALSO mention that I want to use the "jp@gc - Variables From CSV File" plugin not the out-of-box "CSV Data Set Config"

Vincent Daburon

unread,
Dec 18, 2014, 5:38:08 AM12/18/14
to jmeter-...@googlegroups.com, jack...@gmail.com
Hi,

You could add a properties in the user.properties file in the <JMETER_HOME>/bin directory
This properties could be FILE_CSV=/dir1/file1 for the 1st load injector (slave jmeter)
and FILE_CSV=/dir2/file2 for 2sd load injector.

and use ${__P(FILE_CSV)} in the file name

Or start jmeter_server.bat this a parameter like -JFILE_CSV=/dir1/file1

Or in the SetUpThread group add a beanshell
and add parameter ${__machineName()}
and test the machine name
log.info("computerMachine = " + computerMachine );
if (computerMachine .contains("computer1")) {
props.setProperty("K_FILE", "D:/d1/file1");
}
if (computerMachine .contains("computer2")) {
props.setProperty("K_FILE", "D:/d2/file2");
}

Regards.
Vincent D.

halpe...@gmail.com

unread,
Aug 19, 2018, 8:36:09 AM8/19/18
to jmeter-plugins
Have you found a solution for using relative path in  "jp@gc - Variables From CSV File" plugin?
I am also interested in similar solution
Kobi H.

artem....@blazemeter.com

unread,
Aug 20, 2018, 5:35:48 AM8/20/18
to jmeter-plugins
Sure, you can use relative path in this plugin.

You should set relative path to Java  'user.dir'  property.  It's the directory where java was run from, where you started the JVM. Does not have to be within the user's home directory. It can be anywhere where the user has permission to run java. (https://stackoverflow.com/questions/16239130/java-user-dir-property-what-exactly-does-it-mean

For example I made `cd` to `/home/artem/jmx`, then I run JMeter and my `user.dir` will be `/home/artem/jmx`

If I store my CSV file in dir `/home/artem/csv/` I should set `../csv/file.csv` in this plugin


Artem

воскресенье, 19 августа 2018 г., 15:36:09 UTC+3 пользователь halpe...@gmail.com написал:
Reply all
Reply to author
Forward
0 new messages