I am trying to parse the json response returned by the gatling server.
My answer from the server:
SessionAttribute( Session( GetServices, 3491823964710285818-0, Map( gatling.http.cache.etagStore -> Map(https://api.xyz.com/services -> ), gatling.http.cache.lastModifiedStore -> Map(https://api.xyz.com/services -> ), myresponse -> { "created":"2014-12-16T22:06:59.149+0000", "id":"x8utwb2unq8uey23vpj64t65", "name":"myservice", "updated":"2014-12-16T22:06:59.149+0000", "version":null }), 1418767654142,622, OK,List(),<function1>),id)
I do this in my script:
val scn = scenario("GetServices") .exec(http("Get all Services") .post("/services") .body(StringBody("""{ "name": "myservice" }""")).asJSON .headers(sentHeaders) .check(jsonPath("$") .saveAs("myresponse")) ).exec(session => { println(session.get("id")) session })
He is still typing the whole answer. How can I just get the id "x8utwb2unq8uey23vpj64t65" ?
json scala gatling
user1075958
source share