This is a simple example on how to create and use a counter inside JMeter. The counter can be set up so that it increments independently for each user i.e. thread, or it can be a global counter. The process to define either type of counter is almost identical.
To create a counter, start with a Thread Group, right click it and select Add
> Config Element
This will present the counter configuration pane. The Name
is just what will appear on the left in the Test Plan, the important value to set is the Reference Name
, this is the variable name that the counter will be referred to in the rest of the project.
Other variables should be configured as desired with a start, increment and maximum parameters. If Track counter independently for each user
is ticked, the counter will be a per-thread counter instead of a global counter.
To use the counter, for example in a SOAP/XMP-RPC Request simply refer to it by its name, like so:
A quick disclaimer...
Although I put in a great effort into researching all the topics I cover, mistakes can happen.
Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.
All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle).
Use of any information contained in this blog post/article is subject to this disclaimer