Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jmeter - how to add prefix to a counter. Similar to a random variable

Tags:

jmeter

Currently in the random variable I can put a prefix or suffix in the output format of the variable. However this nice feature is not available for a simple counter controller. Concatenating string+${counter} every time when i use the variable is not a good option form me since i do this a lot.

Is there any way to achieve prefix+counter in a way random variable do this?

Thanks.

like image 888
TestMechanic Avatar asked Oct 07 '22 11:10

TestMechanic


1 Answers

Are you talking about Counter Config Element ?

If so it is possible using Number Format attribute:

  • http://jmeter.apache.org/usermanual/component_reference.html#Counter

See:

   Format   Optional format, e.g. 000 will format as 001, 002 etc. 
   This is passed to DecimalFormat, so any valid formats can be used. 
   If there is a problem interpreting the format, then it is ignored. 
   [The default format is generated using Long.toString()] 

enter image description here

like image 174
UBIK LOAD PACK Avatar answered Oct 10 '22 03:10

UBIK LOAD PACK