JMeter __P function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values.
Also documented in context in the full Functions and Variables reference.
TL;DR: __P is the short form of __property built specifically for command-line overrides (jmeter -Jgroup1.threads=7) โ no variable-saving option, and its implicit default is 1 (chosen to be a safe fallback for thread counts, loops, and ramp-up).
This is a simplified property function which is
intended for use with properties defined on the command line.
Unlike the __property function, there is no option to save the value in a variable,
and if no default value is supplied, it is assumed to be 1.
The value of 1 was chosen because it is valid for common test variables such
as loops, thread count, ramp up etc.
For example: ` Define the property value:
jmeter -Jgroup1.threads=7 -Jhostname1=www.realhost.eduFetch the values:
\${__P(group1.threads)} - return the value of group1.threads
\${__P(group1.loops)} - return the value of group1.loops
\${__P(hostname,www.dummy.org)} - return value of property hostname or www.dummy.org if not defined
In the examples above, the first function call would return7, the second would return 1and the last would returnwww.dummy.org`
(unless those properties were defined elsewhere!)
| Name | Required | Description |
|---|---|---|
| Property Name | Yes | The property name to be retrieved. |
| Default Value | No | The default value for the property. If omitted, the default is set to โ1โ. |
Example
Section titled โExampleโjmeter -Jgroup1.threads=7 -Jhostname1=www.example.com${__P(group1.threads)} โ 7${__P(group1.loops)} โ 1 (undefined property, implicit default)${__P(hostname,www.dummy.org)} โ www.dummy.org (undefined, explicit default)This is the standard pattern behind CI/CD load tests that tune concurrency per environment without editing the .jmx file โ see the CLI Command Builder to construct the -J flags.