Issue when trying to pass parameter from response to header of next service

Facing issue while trying to pass parameter from first request to the header of the next. Could someone please let me know what am I doing wrong here?


package computerdatabase

import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._

class Test1 extends Simulation {

val httpProtocol = http.baseUrl(“”)

val httpProtocol_1 = http.baseUrl(“”)

val header = Map(
“Content-Type” → “application/soap+xml;charset=UTF-8”,
“Connection” → “alive”,
“User-agent” → “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0”)

val header_1 = Map(

object pl{
val layer7 = scenario(“getauth”).exec(http(“GetAuthToken”)
.body(StringBody("""{“client_id” : “123456”,
“client_secret” : “abc123456”,
“grant_type” : “client_credentials”}

val pl1 = exec(http(“dental”)
.body(StringBody("""<?xml version="1.0" encoding="utf-8"?>



val auth = scenario(“getauth”).exec(pl.layer7)
val pl1_1 = scenario(“claimsummary”).exec(pl.pl1)

setUp(auth.inject(rampUsers(1) during (1 seconds)).protocols(httpProtocol_1),
pl1_1.inject(nothingFor(10 seconds),
rampUsers(10) during (5 seconds)).protocols(httpProtocol))


value asJSON is not a member of io.gatling.http.request.builder.HttpRequestBuilder possible cause: maybe a semicolon is missing beforevalue asJSON’?

15:19:49.866 [ERROR] i.g.c.ZincCompiler$ - one error found
15:19:49.867 [ERROR] i.g.c.ZincCompiler$ - Compilation crashed null

Thank you Stephane! Could you please take a look at the following issue too, that’s second part of the problem statement where I need to pass auth token to a set of requests which need to run in parallel but auth token need to be executed only once. Appreciate all your help!!topic/gatling/PJOXSkUr3sg


I noticed that in the new versions of Gatling, there are some errors on over or asJSON. Then, I got that they’ve renamed.

You’re really coming from a very old version, this renaming happened in Gatling 3.0, more than 2 years ago.

Yes, now I got that. I was following an old course about Gatling and faced some problems like:

  • value over is not a member of
  • value asJSON is not a member of io.gatling.http.request.builder.HttpRequestBuilder

If you’re looking for up-to-date online training, I recommend you have a look at our official Gatling Academy.