ERK
ERK

Reputation: 406

Gatling check status saveAs function doesn't work with multiple status check

I am trying to check the HTTP status and save the status code in a variable, but in Gatling, if I add multiple status checks as follows.

.asJson().check(status().saveAs(RESPONSE_HTTP_STATUS_CODE), status().is(HttpStatus.SC_ACCEPTED)

saveAs function doesn't invoke and RESPONSE_HTTP_STATUS_CODE is always null.

What is the issue here?

Please refer to the following MVP to reproduce the issue.

https://github.com/eranga4u/demo-gatling

PS: I am not a Gatling expert.

Upvotes: 0

Views: 64

Answers (1)

Stéphane LANDELLE
Stéphane LANDELLE

Reputation: 6623

The behavior you're observing is completely expected.

You're using exitHereIfFailed and exitBlockOnFail in several places in your scenario. When a request is failing, they cause the piece of code you're looking at to be bypassed.

Upvotes: 0

Related Questions