Taurus allows you to pass properties and variables to JMeter at different levels of granularity.
JMeter Properties
Properties can be defined globally (module-level) or locally (scenario-level). Scenario-level properties take priority and are merged into the global set.
- Global Properties: Defined under
modules.jmeter.properties. - Scenario Properties: Defined under
scenarios.<name>.properties. - System Properties: Defined under
modules.jmeter.system-properties.
Use the JMeter syntax ${__P(property_name, default)} to access these in your scripts.
Scenario Variables
Variables are defined under scenarios.<name>.variables and can only be used at the scenario level. They are accessed using ${variable_name} syntax.
execution:
- concurrency: ${__P(my_conc,3)}
ramp-up: 30
hold-for: ${__P(my_hold,10)}
scenario: with_prop
modules:
jmeter:
properties:
my_conc: 10
my_hold: 20
system-properties:
sun.net.http.allowRestrictedHeaders: "true"
scenarios:
with_prop:
requests:
- http://blazedemo.com/${__P(sub_dir)}
properties:
my_hold: 15 # scenario-level property has priority
sub_dir: contacts
sc_with_vars:
variables:
subdir: contacts
ref: http://gettaurus.org
requests:
- url: http://blazedemo.com/${subdir}
headers:
Referer: ${ref}