JMeter __samplerName 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.
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:
\${__samplerName()}| Name | Required | Description |
|---|---|---|
| Variable Name | No | A reference name - refName - for reusing the value created by this function. Stored values are of the form \${refName}. |