Gatling:使用 Gatling 2 获取 cookie 值

dat*_*ser 1 scala stress-testing gatling

嗨,我想从 cookie 中提取一个值并将该 cookie 值作为参数传递给下一个 exec()。我发现一些语法不适用于新的 Gatling 2。有人可以举个例子吗?

谢谢

Ste*_*lle 5

在 Gatling Goole Group 上回答:从“Set-Cookie”标题中使用正则表达式提取:

.check(headerRegex("Set-Cookie", "yourRegexHere").saveAs("attributeName"))
Run Code Online (Sandbox Code Playgroud)