How to pass dynamic value in String Body

49 views
Skip to first unread message

Naveen Goud

unread,
Nov 15, 2017, 7:00:15 AM11/15/17
to Gatling User Group
Hi I have a scenario and I need to pass one dynamic value in the Body.

For Example I have below scenario. I need to pass ${florgType} instead of "DfolFleetOrgType"


val storeServiceMapping = scenario("StoreServiceMappingScenario")
.exec(http("StoreServiceMapping")
.post("/brimpx/operation/servicemapping")
.headers(headers_store_service_mapping)
.body(StringBody("{\"serviceId\":\"DF-VH\",\"florgType\":\"DfolFleetOrgType\"}"))
.check(status.is(200)))

Can any one have idea on it. The above example working without any modifications.


Thanks,
Naveen

dkin2

unread,
Nov 23, 2017, 11:28:47 AM11/23/17
to Gatling User Group
Just replace DfolFleetOrgType with ${florgType}

So your Body will look like: 
.body(StringBody("{\"serviceId\":\"DF-VH\",\"florgType\":\"${florgType}\"}"))
Reply all
Reply to author
Forward
0 new messages