Akhil
Akhil

Reputation: 183

Gatling-scala check 2 status codes (either or)

In a gatling test, I am trying to verify whether the response for a request is either 204 or 404.

val scn = scenario("Scenario A").exec(httpRequest
    .check(status.is(204)))

where httpRequest is a request defined elsewhere. I want to check whether the test to pass is response is 204 or 404. Couldnt find anything to use or in a check

Upvotes: 12

Views: 10864

Answers (1)

Stephane Landelle
Stephane Landelle

Reputation: 7038

Please have a look at the documentation:

status.in(204, 404)

Upvotes: 24

Related Questions