Combining data from JSON respnose with data in parameterlist used by a request body

I have:



.header(“X-Token”, “mock”)


where activateCoupons.json looks like this:

{“offerId”: “${offerId}”, “membershipId”: “${memberID}”, “osName”: “iOS”, “osVersion”: “8.02”}


and where memeberInfo.csv looks like this:

memberID,offerId 1,1 1,2 1,3 2,1 2,2 2,3 3,1 3,2 3,3

I want to modify this (it is working great)

The .exec before the one I have provided gets a response body looking (partly) like this:




I want to get the ‘id’ and I use:


This also Works as expected, but can I a request body combining the “on-the-fly” ‘id’ with parameters in a .csv file and still use ELFileBody?

Or should I use StringBody like this:

//.body(StringBody("""{“offerId”: “${couponId}”, “membershipId”: “${memberID}”, “osName”: “iOS”, “osVersion”: “8.02”}""")).asJSON


I would prefer to use ElFileBody, but I do not know how to combine testdata from the response “on-the-fly” with “static testdata”.



Ok, to be spesific, can I combine testdata from the response and saved as a local variable, with testdata from a datasource, a .csv file like this:

{"offerId": "${offerId}", "membershipId": "${memberID}", "osName": "iOS", "osVersion": "8.02"}

Where 'offerId' is regex'ed from a json response and 'memberId' is from a .csv file?

Is this possible to combine there two using ELFileBody and a request body?

Yes, of course