Skip to content

__P

JMeter __P function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values.

Difficulty
intermediate
Guide type
reference
Estimated read time
1 min read
Last verified version
Verified JMeter 5.6

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.edu

Fetch 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!)

NameRequiredDescription
Property NameYesThe property name to be retrieved.
Default ValueNoThe default value for the property. If omitted, the default is set to “1”.
Terminal window
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.

On this page