Using a variable for the Thread group Acceleration time
You cannot use variables in a theme group setting , as thread groups are initialized at startup time, before reading any variables.
If you need to customize the number of threads and / or the ramp period, use __ P () , for example:
-
${__P(threads,)}
-
${__P(rampup,)}
The above properties threads
and rampup
can be defined in several ways:
-
If you start JMeter in non-GUI mode , you can pass properties via the -J command line switch as
jmeter -Jthreads=50 -Jrampup=30 -n -t /path/to/your/testplan.jmx
The same approach will work in GUI mode, however, it is not recommended to use the GUI to execute the load test as it is quite resource intensive and can mess up your test.
-
These properties can be defined in the user.properties file (located in the / bin folder of your JMeter installation) as follows:
threads=50 rampup=30
After restarting, JMeter will pick the properties up and you can pass them through the __P () function as described above.
See the Apache JMeter Properties Configuration Guide for complete details on the various JMeter properties and how to work with them.
source to share
There is no reason it works for # threads, but doesn't work for rise times. I have successfully used custom properties for both.
1 is the default value in JMeter if the variable cannot be resolved correctly. You probably made a typo. To investigate the problem, you can use the Property Display (right click on the WorkBench / Add / Non-Test Element / Property Display).
If that doesn't help, please post a link to the screenshot of the thread group and the corresponding part of your config where you define the rise time variable.
EDIT: example
This is how I usually work with custom properties stored in external files (and it works for extensibility too):
- define a custom variable at test plan level eg. someVarName - $ {__ P (someVarName)}
- then use this var for example. in ramp-up as $ {someVarName}
source to share