簡體   English   中英

Gatling scala:檢查狀態碼是否屬於列表

[英]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))

你傳遞了一些混合了SeqInt的東西。

中的方法in Seq[Int]

.check(
      status.in((201 to 209) :+ 303 :+ 304)
    )

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM