Is there a way of accessing the current script's absolute physical path via a variable/property? There doesn't appear to be anything listed via a Debug Sampler.
It's incredibly annoying that actions like loading CSV files and JMX Includes uses the current working directory as its relative path.
/lib Folder: The lib folder contains all the executable jar files which are required for JMeter functioning. These files are as same as jar file of java. /lib folder contains two subfolders /ext and /JUnit. The /ext or extension sub-folders are useful when you add an external plugin in the JMeter.
jmx file in Windows 10 operating system. Right click on valid JMeter test plan, go to Open with > Choose another app as shown below. Upon clicking on Open, JMeter will launch and open the file where you right clicked on it.
Relative paths are resolved relative to the current working directory (which defaults to the bin/ directory). JMeter also supports paths relative to the directory containing the current test plan (JMX file). If the path name begins with "~/" (or whatever is in the jmeter. save.
I used the answer provided by haridsv. It worked great except that I needed to put the directory to the JMX file in a variable. I made a "User Defined Variables" component and used BeanShell in the variable's "Value" field like this:
${__BeanShell(import org.apache.jmeter.services.FileServer; FileServer.getFileServer().getBaseDir();)}${__BeanShell(File.separator,)}
The first BeanShell section calls the Java class that gets the directory in question. The second appends a file separator to the path, which is of course optional.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With