How to pass or get the value from Map (random generator) to PebbleStringBody in Gatling with Scala
val names = Iterator.continually {
Map("name" -> s"PerfTest ${Random.alphanumeric.take(10).mkString}")
}
.feed(names)
.exec(http("PerfTest")
.post("/PerfTest/bulk")
.body(PebbleStringBody(
"""| [
| {% set Iteratecount = 2 %}
| {% for t in range(1,Iteratecount) %}
| {
| "name": "{{name}}", //cannot get the value from feeder :Map or from Json path
| "TestID": "9888988FRFRFDD887887ESES",
| "typeId": "9888988FRFRFDD887887ESES",
| "statusId": "9888988FRFRFDD887887ESES",
| "excludedFromAutoHyperlinking": true
| }
| {% if loop.last %}
| {% else %},{% endif %}
| {% endfor %}
| ]""".stripMargin)).asJson
.check(status.is(200))
)
also could not pass the value from jsonPath to pebbleString body
.check(jsonPath("$.result.name").saveAs("name")
Please help with the solution