Follow Slashdot stories on Twitter


Forgot your password?
User Journal

Journal Greyfox's Journal: Jmeter Does Not Have Access to Environment Variables?

Maybe not, but if you "set > workspace/" and pass your Job Path in to jmeter as a property, you can read the damn things back out with a beanshell sampler later on. Handy for grabbing variables from your Hudson parameterized build. Just don't forget to define JobPath as ${__P(JobPath,)} in your user defined variables.


String response = "";

try {
      BufferedReader in = new BufferedReader(new FileReader("${JobPath}/workspace/"));
      String nextLine = in.readLine();
      while(null != nextLine) {
              String[] keyval = nextLine.split("=");
              if (2 == keyval.length) {
              response = response + nextLine + "\n";
              nextLine = in.readLine();
} catch ( e) {
        response = "Unable to locate properties file for environment; using defaults.";


This discussion has been archived. No new comments can be posted.

Jmeter Does Not Have Access to Environment Variables?

Comments Filter:

We warn the reader in advance that the proof presented here depends on a clever but highly unmotivated trick. -- Howard Anton, "Elementary Linear Algebra"