Unable to Extract a vale from JSON response

Hi All,

I want to extract the message Id from the below response:
{
“statusCode”: “NO RECORDS”,
“messageId”: “1472df40-6632-11e7-b2c1-005056becb71
}

When I tried to capture the value, I am getting the error:
Code used to correlate : .check(regex(""“messageId”: “([0-9][a-b][A-B])”""")).saveAs(“cMsgId”))

Error : value saveAs is not a member of io.gatling.http.request.builder.HttpRequestBuilder

When I added the assertion, it is working fine :
.check(regex(""“messageId”"")))

Thanks in advance,

Regards.
Ravichandran

Ravi, you have:

  1. four trailing double-quotes, instead of three, for the regex
  2. two braces instead of one closing the regex

Syntax corrected, you’d have:

.check(regex(""“messageId”: “([0-9][a-b][A-B])”"").saveAs(“cMsgId”))