Jmeter - 如何为计数器添加前缀。类似于随机变量

时间:2012-10-03 15:08:20

标签: jmeter

目前在随机变量中,我可以在变量的输出格式中加上前缀或后缀。然而,这个不错的功能不适用于简单的计数器控制器。每当我使用变量时连接字符串+ $ {counter}不是一个很好的选择,因为我做了很多。

有没有办法以随机变量的方式实现前缀+计数器呢?

感谢。

2 个答案:

答案 0 :(得分:4)

你在谈论Counter Config Element吗?

如果是这样,可以使用数字格式属性:

见:

   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

答案 1 :(得分:0)

在“计数器”的“数字格式”字段上,用0 ... 0表示模式以进行数值累加。

示例:

“数字格式”模式:prefix_000_suffix

实际值:prefix_001_suffix,prefix_002_suffix,prefix_003_suffix,...

希望这会有所帮助!

相关问题