Unexpected 500 response code during execution

I’m executing below code and even when there is no check for status getting unexpected 500 status as status.find.in([200, 209], 304), found 500

package collectionApis;

import io.gatling.javaapi.core.*;
import io.gatling.javaapi.http.*;
import requestBodies.CollectionRequestBodies;


import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.*;

public class VAPayment extends Simulation {

    private final ScenarioBuilder[] scnList = new ScenarioBuilder[5];

    private int users = 1;
    private HttpProtocolBuilder httpProtocol = http
            .baseUrl("https://lannister.uat.creditsaison.xyz")
            .contentTypeHeader("application/json")
            .authorizationHeader("Basic QGRNMU46UEAkJFcwckQ=");


    private void scnList() {
        CollectionRequestBodies vapayment = new CollectionRequestBodies();
       System.out.println(vapayment.VAPayment());

        for (int i = 0; i <= 4; i++) {

            scnList[i] = scenario("VA Payment " + users + "Users")
                    .exec(
                            http("VA Payment " + users + "Users")
                                    .post("/api/v1/axis/notification")
                                    .body(StringBody(vapayment.VAPayment())).asJson());
            users += 1;
        }
    }
    {
        scnList();
        setUp(
                scnList[0].injectOpen(rampUsers(5).during(3))
                        .andThen(
                                scnList[1].injectOpen(nothingFor(15), rampUsers(6).during(3))
                        )
                        .andThen(
                                scnList[2].injectOpen(nothingFor(15), rampUsers(7).during(3))
                        )
                        .andThen(
                                scnList[3].injectOpen(nothingFor(15), rampUsers(8).during(3))
                        )
                        .andThen(
                                scnList[4].injectOpen(nothingFor(15), rampUsers(9).during(3))
                        )



        ).protocols(httpProtocol);
    }
}```

So? What is your issue?

  • why you have a check that consider 500 as a failure? => Gatling HTTP protocol reference - checks
  • why you experience 500 status codes? => that’s for you to figure out, that’s a server side failure

Thanks @slandelle for mentioning the implicit checks that gatling does. Actually, we are getting unexpected 500 even though the API response is 200, will have to look at it again.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.