0

I'm looking to import an assertion script from a location rather than define it within a .jmx file: Import Script

The main problem i'm running into is that the default location appears to be the JMeter installation location, rather than the location of the .jmx which which is currently open. The installation location can differ depending on user, whereas the common script i'm looking for would be a folder above the .jmx location.

aynber
  • 22,380
  • 8
  • 50
  • 63
  • Does this answer your question? [How to get the absolute folder location of a Jmeter .jmx project file from within itself?](https://stackoverflow.com/questions/27809422/how-to-get-the-absolute-folder-location-of-a-jmeter-jmx-project-file-from-withi) – SiKing Apr 22 '22 at 16:59

1 Answers1

0

If you're a Groovy expert it shouldn't be a problem to determine the "default" location. The relevant function is FileServer.getBaseDir() and when the

so if you do something like:

println('Current base is: ' + org.apache.jmeter.services.FileServer.getFileServer().getBaseDir())

it will return the folder where the current .jmx file is located:

enter image description here

More information: Scripting JMeter Assertions in Groovy - A Tutorial

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • This is what I was looking for. The files I wanted were a few folders above the location of the .jmx file so once I had that location it was good to go. – Chris Mallinson Apr 25 '22 at 11:42