Skip to content

__samplerName

JMeter __samplerName 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.

The samplerName function returns the name (i.e. label) of the current sampler.

The function does not work in Test elements that donโ€™t have an associated sampler. For example the Test Plan. Configuration elements also donโ€™t have an associated sampler. However some Configuration elements are referenced directly by samplers, such as the HTTP Header Manager and Http Cookie Manager, and in this case the functions are resolved in the context of the Http Sampler. Pre-Processors, Post-Processors and Assertions always have an associated Sampler.

Example:

Terminal window
\${__samplerName()}
NameRequiredDescription
Variable NameNoA reference name - refName - for reusing the value created by this function. Stored values are of the form \${refName}.
On this page