'How to increment the body of the payload in jmeter

{
  "productIds" : 
[
    "p1": "value1"
  ]
}

{
  "productIds" : 
[
    "p1": "value2"
  ]
}

{
  "productIds" : 
[
    "p1": "value3"
  ]
}

i want the above data part to be saved in a variable and to be printed for 1000 times in the payload with p1 having dynamic value for every part,.



Solution 1:[1]

Either use Counter configuration element or __counter() function instead of 1 hard-coded value:

 { "productIds" : [ "p1": "value${__counter(FALSE,)}" ] }

Demo:

enter image description here

More information: How to Use a Counter in a JMeter Test

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T