I am currently facing a weird problem, which might not be described in the docs. I have GET calls, where I need the body of the response for the next call.
After some time in a scenario the response seems to be empty and parsing of the document is not possible. It looks like k6 is neglecting the responses (discardResponseBodies = false). When I had a look at the response they were just empty. It occurs in every scenario no matter what scenario type is configured.
The weird thing is that when running the exactly same script without scenario and with default function (standard mode), the script is running decent.
I would guess that you are getting either timeout requests due to the system under test or k6 not being able to handle the traffic. Or just any other kind of not expected status code (500 for example) which leads to the body being empty.
You can probably print the response in case of problems as in
I am facing the same problem. Is there any solution yet?
Respose is 200 OK. It works with some other endpoints. I donât find any pattern in the behavior. Some JSON response work correclty, but a simple âHello Worldâ response from a test endpoint turns into an empty body in K6.
It works correctly with postman or other clients.
Hi,
I found the problem. My fault. I have used a wrong authentication token and my endpoint responded with 200 OK, which is totally wrong and was missleading. Works fine now.
Sorry, has been my fault!