Murali Krishna
Murali Krishna

Reputation: 11

Gatling 2.0.3 - Mapping values to template

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 first POST call [BOLDED] and I am saving the response into two values. Now I am passing the values to another POST call[BOLDED ITALIC].

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") .feed(correlationIdFeeder) .feed(dataFeeder) .feed(csvFeeder) .exec( http("Creating tm token given an external token") .post(tokenization_endpoint) .body(ELFileBody("tokenization.json")).asJSON
.check(status.is(200))
.check(jsonPath("$.payment_token").saveAs("payment_token"))

.check(jsonPath("$.payment_transaction_id").saveAs("payment_transaction_id")) ) .exec( http("Authorization flow") .post(authorization_endpoint) .body(ELFileBody("authorization.json"), Map("payment_token" -> "${payment_token}", "payment_transaction_id" -> "${payment_transaction_id}", "transaction_date" -> "${current_date}", "value" -> "${amount}" ) ).asJSON
.check(status.is(200))
.check(jsonPath("$.transaction_details.transaction_status").is("Approved")) .check(jsonPath("$.transaction_details.transaction_status_code").is("0x20")) .check(jsonPath("$.transaction_details.payment_token").is("${payment_token}")) .check(jsonPath("$.transaction_details.payment_transaction_id").is("${payment_transaction_id}")) .check(jsonPath("$.transaction_details.transaction_date").is("${current_date}")) )

Thank You Murali.

Upvotes: 0

Views: 393

Answers (1)

Stephane Landelle
Stephane Landelle

Reputation: 7038

2 things:

  • First, you're using Gatling 2.0.3 which is quite old, and will hit tons of bugs that have already been fixed, and miss tons of features. Current latest version is 2.1.7.
  • Then, it looks like you're trying to do something similar to how things worked in Gatling 1, when we used Scalate for templating. This is not how things work now! With ELFileBody, you directly use Gatling EL in your template. Please read the documentation.

Upvotes: 0

Related Questions