Hi I want to extract a value from a cookie and pass that cookie value as a parameter to the next exec(). I found some syntax which does not work for the new Gatling 2. Could someone please show an example?
Thanks
Hi I want to extract a value from a cookie and pass that cookie value as a parameter to the next exec(). I found some syntax which does not work for the new Gatling 2. Could someone please show an example?
Thanks
Answered on Gatling Goole Group: extract with a regex from the "Set-Cookie" header:
.check(headerRegex("Set-Cookie", "yourRegexHere").saveAs("attributeName"))
Gatling can deal directly with cookies. This copies the JSESSIONID cookie in the session from which it can be retrieved.
exec(getCookieValue(CookieKey("JSESSIONID").withPath("/ApplPath")))
exec(session => "JSESSIONID=" + session("JSESSIONID").as[String]; session)
See Gatling current documentation https://gatling.io/docs/current/http/http_helpers/