0

I want to run unit tests in my program whenever the api receives a request. the api returns a response once when it has received a valid request, but then later it will send once it's done with the unit tests. The first response is shown in Postman, but not the second repsonse. I can see that it getting send using wireshark though.

These are two separate responses and since this api is what it is, I don't have the power to change it. How can i use Postman to receive the second response as well?

Edit additional information is requested so: I have in my collection a POST request and when I trigger it I get a response back with a body with:

{
    "messageType" : "Response"
    "options" : "async"
}

Then the code can see that another response is incoming later, because of the async token.

A bit later another response is received:

{
    "messageType" : "Response"
    "Tests" : "11 ok tests"
}

But in postman I can't seem to receive the second response, as the transaction is finished after the first one. How can I make postman also receive the second response?

Calvin Bootsman
  • 157
  • 1
  • 9
  • Can you share first response and second response data with sending APIs? It will help to understand your situation. – Bench Vue Dec 28 '22 at 10:54
  • It is strange it seems API server implemented wrong. It can be possible like this `https://stackoverflow.com/questions/25209073/sending-multiple-responses-with-the-same-response-object-in-express-js` . I think if you test you can send another request then compare previous and second response. This is how to test it. https://www.postman.com/postman/workspace/postman-answers/request/13455110-660e4fbf-560c-4581-9e37-7e817f679fa2 Request A's Tests section and Request B's Tests. – Bench Vue Dec 28 '22 at 14:44

0 Answers0