Good day. Hope you and your family are doing well.
I’m new to k6 and I was doing some tool assessment for this (performance test).
I am trying out k6 for load testing and came across an issue. For all other APIs, it works fine but one endpoint is always giving 500 Internal Server Error via k6. It works fine with Postman by the way. Refer to screenshots below:
via kc cloud:
Welcome to the community forum
I understand the second screenshot is from a local test with
--http-debug="full", is that correct? And it’s not giving you clues as to what is missing in the k6 requests for this endpoint.
Could you share the Postman screenshot with all the settings for the endpoint that is giving you a
500 status with k6?
Also, can you run the same request with a
curl -v, to showcase the response when you get a
200 vs. the k6 requests that fail?
We suspect there might be some headers missing in the k6 response and we should be able to compare those with what k6 is doing, and see if there is anything missing for that particular request.
Sorry for the late reply. But here is the one from postman:
Thanks for sharing the screenshots, and no worries for the delay.
I would initially attempt to make sure the request headers are all there, to discard that the API is failing due to a missing header (like
Accept: '*/*'), or values that are not exactly the same (
Accept-Encoding). It could also help sending a token header as postman does, depending on how the API works.
Could you share the sanitized k6 script you are using, so we can check how you handle the cookies and the requests, and send the json body? Initially I suspected missing headers (since the requests that fail are the ones that would require handling a session), which could be fixed with dynamic correlation. However, those seem the same as Postman sends as far as I can see. And from the response your API returns (
Object reference not set to an instance of an object), it could be that it does not recognize the