Search code examples
javaapachejmeterrelative-pathjmeter-plugins

Jmeter Set Relative Path Relative to Jmeter Install in User Defined Variables


I want to know if there is a way to reference a file in the 'User Defined Variables" of the Test Plan relative to the install of Jmeter? For example instead of having a variable called 'sampleFile' and its value: C:\Jmeter\apache-jmeter-3.2\bin\example.txt I want to have a variable called 'sampleFile' and its value be relative to the install so: ..\bin\example.txt or ..\lib\example.txt. I am asking this because I want to place the script on a server.

Long story short: Can I make paths relative to the install of Jmeter? And if so how? Thanks!


Solution

  • You can refer it using __P() function like:

    ${__P(user.dir,)}
    

    See: