Using a variable for the Thread group Acceleration time

how to adjust the rise time of a thread group using jmeter variable, i tried for both the number of threads and increase the rise time. No threads are working fine, but the rise time is default to 1 and the value of the variable does not take effect, appreciate any help

+3


source to share


3 answers


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,)}

Properties



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.

+5


source


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}
+1


source


You cannot use variables for these values, only properties:

Properties are not the same as variables. Variables are local to the thread; properties are common to all threads and must be referenced using the __P or __property function.

+1


source







All Articles