I was following blazemeter tutorial on how to run Jmeter script from the command line (cmd.exe in Windows10 OS). I'm trying to pass environment variable to the Jmeter ${__env}
(according to this page) custom function, using Jmeter script from the command line. Below is the screenshot of the env function in Jmeter UI
I've also tried without quotes ${__env(password)}
and also using JSR223 PreProcessor
vars.put("password",${__env(password)});
but that didn't work either.
Below is my command line
set password=MyPassword123
jmeter -n -t C:\Work\Jmeter\MyScript.jmx
But Jmeter fails to execute my test plan
Creating summariser <summary>
Created the tree successfully using C:\Work\Jmeter\MyScript.jmx
Starting the test @ Fri Sep 28 16:45:38 EDT 2018 (1538167538606)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary = 2 in 00:00:01 = 3.1/s Avg: 250 Min: 1 Max: 499 Err: 1 (50.00%)
Tidying up ... @ Fri Sep 28 16:45:39 EDT 2018 (1538167539431)
... end of run
Is it possible to read environment variable using Jmeter? How to properly set it up. Has anyone able to achieve this before? Thanks a lot people!