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("").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())
    .acceptEncodingHeader("gzip, deflate, br")
    .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:
      .formParam("__EVENTTARGET", "")
      .formParam("__EVENTARGUMENT", "")
      .formParam("__VIEWSTATE", "${VIEWSTATE}")
      .formParam("captchaValidated", "0")

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


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 =>


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 :