【问题标题】:How to save and use value of cookie in Gatling?如何在 Gatling 中保存和使用 cookie 的价值?
【发布时间】:2021-05-20 11:45:48
【问题描述】:

我对使用 Gatling 进行负载测试相对较新,所有方面仍然不太清楚。测试场景涉及捕获一个cookie值,可以是:2、4、6。我使用了以下:

http("User generation")
.get("url")
.check(headerRegex("Set-Cookie", """status_id=(.*?);""").saveAs("status"))

结果是一个错误:

headerRegex((Set-Cookie, status_id=(.*?);)).find.exists, found nothing

我按照文档做了一切,但没有达到结果,请告诉我如何拉取cookie的值并在以后的脚本中使用这个值?谢谢!

【问题讨论】:

    标签: performance-testing gatling scala-gatling


    【解决方案1】:

    使用getCookieValue,参见documentation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多