Gatling 2.0.3 - Mapping values to template

Hi All,

I am trying to Map values to the templete. I am testing web services. I need to populate response from the first rest call to another rest call as a request. I am doing in the below.

The RED color is the first POST call and I am saving the response into two values. Now I am passing the values to another POST call in YELLOW color.

I am getting the below error. Please help to solve this issue
too many arguments for method body: (bd:io.gatling.http.request.Body)io.gatling.http.request.builder.HttpRequestWithParamsBuilder

val authorization = scenario(“Authorization”)
http(“Creating tm token given an external token”)
http(“Authorization flow”)
.body(ELFileBody(“authorization.json”), Map(“payment_token” → “${payment_token}”, “payment_transaction_id” → “${payment_transaction_id}”, “transaction_date” → “${current_date}”, “value” → “${amount}” ) ).asJSON

Thank You

Error says it all. .body only takes one argument but you are passing two.

You can include all payment in the request body file. ElFilebody is used when you want to programmatically change parameters.

Can you share me how to write.


Here is an example

val scn = scenario("xxxx")
  .exec(http("Submit JSON")
    .get(uri1 + """/xxxxx"""))

In the request body, i.e. CreateNonxxxx_request_0018.txt

Notice how Gatling EL take those values from and parameter-ize it.

{ "Id": "", "ActivityDate": "${ActivityDate}", "MatterId": "${MatterId}", "StaffRef": "${StaffRef}", "TimeSpent": "${TimeSpent}", "ActivityRef": "${ActivityRef}", "ActivityDescription": "", "ActivityComment": "${ActivityComment}", "ActivityCommentMarkup": "", "BillableEntityRef": "${BillableEntityRef}", "BillableEntityDescription": "", "RiskAreaDescription": "", "RoleDescription": "", "StatusDescription": "", "ReviewComment": "", "BillingPeriod": "", "Summary": "${Summary}" }

Thank You. Its working.