Reputation: 11
${__BeanShell(import org.apache.jmeter.services.FileServer; FileServer.getFileServer().getBaseDir();)}${__BeanShell(File.separator,)}upload.xml
Note : In above example ,file upload.xml is not in director where JMX file is present.
I want to put upload.xml in c:/project/configfiles/ folder and for JMX files c:/project/scripts/ folders.
So how I can change the custom folder path in jmeter?
Upvotes: 1
Views: 2593
Reputation: 168237
Be aware that since JMeter 3.1 it is recommended to use JSR223 Test Elements and Groovy language for any form of scripting so I would recommend switching to __groovy() function, the relevant code will look like:
${__groovy(new File(org.apache.jmeter.services.FileServer.getFileServer().getBaseDir() +File.separator+ ".." + File.separator + 'configfiles' + File.separator + "upload.xml").getCanonicalPath(),)}
Demo:
Upvotes: 4