[英]Gatling scala: Check that the status code belongs to a list
对于一个场景,我想检查响应的状态代码是否属于 200-209 或 304 或 404。
我尝试了以下方法,但显然不支持。 而且我在 文档中找不到我的用例。
scenario("Scenario example").exec(httpRequest
.check(status.in(200 to 209, 304, 404)))
除了手动列出代码之外,还有更好的解决方案吗?
.check(status.in(200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 304, 404))
status.in((200 to 209) ++ List(304, 404))
你传递了一些混合了Seq
和Int
的东西。
中的方法in
Seq[Int]
:
.check(
status.in((201 to 209) :+ 303 :+ 304)
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.