www.jensolsson.se
www.jensolsson.se

Reputation: 3073

Execute multiple check's even if the first one fails

In the below example I execute a POST request towards a REST web service using Gatling. There are two checks. I check that status is returned as OK and I also check that there is no errorString returned in the JSON structure.

If the REST web service returns status FAIL and a custom errorString describing the problem I will never see the error string in the console output. It seem like if gatling gives up on the first check that fail.

I would prefer having it to execute all the checks and print all of them that fails so that I get a little bit more info in the logs. Can this be done in some way?

http("Test case")
    .post("/sequence/start")
    .fileBody("startSequence", Map(
         "seq_id" -> "123"
        )
    ).asJSON
    .basicAuth(user, pass)
    .check(jsonPath("$.status").is("OK"), jsonPath("$.errorString").notExists)
    .check(bodyToJson.saveAs("startseq"))

Edit: Question is regarding Gatling 1.5.X

Upvotes: 1

Views: 832

Answers (1)

Kai Sternad
Kai Sternad

Reputation: 22830

I believe a "slow fail" of checks is not possible in Gatling 1.5. See this issue on the Gatling Bug Tracker: https://github.com/excilys/gatling/issues/1501

Upvotes: 2

Related Questions