How to extract different dynamic values from the response of single request using multiple check and saveas and use them in another request??

Below is the base request whose upon redirection is supposed to carry the response that I need to use in another request
I am trying like this
  val httpProtocol = http
    .baseURL("https://www.testciq.com").check(regex("""<input type=\"hidden\" name=\"__VIEWSTATEGENERATOR\" id=\"__VIEWSTATEGENERATOR\" value=\"(.*)/>""").saveAs("VIEWSTATEGENERATOR"),regex("""<input type=\"hidden\" name=\"__EVENTVALIDATION\" id=\"__EVENTVALIDATION\" value=\"(.*)/>""").saveAs("EVENTVALIDATION"),regex("""<input type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEWSTATE\" value=\"(.*)/>\"""").saveAs("VIEWSTATE"))
    .inferHtmlResources(BlackList(""".*\.js""", """.*\.css""", """.*\.gif""", """.*\.jpeg""", """.*\.jpg""", """.*\.ico""", """.*\.woff""", """.*\.(t|o)tf""", """.*\.png"""), WhiteList())
    .acceptHeader("*/*")
    .acceptEncodingHeader("gzip, deflate, br")
    .acceptLanguageHeader("en-US,en;q=0.5")
    .connection("keep-alive")
    .contentTypeHeader("application/x-www-form-urlencoded")
    .userAgentHeader("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0")

and using the saved values in another request like below:
  http("MainLogin")
      .post("https:// sso.beta.mhfi.com:443/oam/server/auth_cred_submit")
      .headers(headers_0)
      .formParam("__EVENTTARGET", "")
      .formParam("__EVENTARGUMENT", "")
      .formParam("__VIEWSTATE", "${VIEWSTATE}")
      .formParam("__VIEWSTATEGENERATOR","${VIEWSTATEGENERATOR}")
      .formParam("__EVENTVALIDATION", "${EVENTVALIDATION}")
      .formParam("captchaValidated", "0")

But this is not working... Any help would be greatly appreciated...Thanks

Hello,

Did you check the values you obtained for ${VIEWSTATE}, ${VIEWSTATEGENERATOR} and ${EVENTVALIDATION} ? What response are you getting ?

since I am new to gatling don’t know… how can I get them checked

Try to print it

`

.exec { session =>
println(session(“VIEWSTATE”).as[String])
session
}

`

Hi… Nikolay and Stephen… Thanks for replying… I have been able to solve the issue by changing the regular expressions… But now stuck with cookie management since gatling is not handling all the cookies because of which some requests are failing

Maybe you can create the cookie by yourself using addCookie : http://gatling.io/docs/2.2.3/http/http_helpers.html?highlight=cookie