I am trying to send multiple request under one test. But I can see that if first request has status 422 then second request also showing the same status 422 when i am checking it from pm.response.to.have.status(…). Whereas the second request has status 409 and it is sending the correct request. And if I put pm.response.to.have.status(409) for second request it is showing fail. I have printed the responseCode.code in console the output is 409.
Are you using the collection runner or newman? Or are you sending a single request?
postman.setNextRequest()only works with the collection runner and Newman where the intent is to run a collection, as opposed to sending a single request. https://learning.getpostman.com/docs/postman/collection_runs/building_workflows/
If I understand correctly, you are trying to run a series of requests inside the Postman application.
The correct way to do this is to use pm.setNextRequest() in the test script.
The seNextRequest will ONLY work in collection runner or Newman, just like @lvaltierra said above.
The name that you are to supply is the name of the request YOU provide to the request, for example the name of the request you have in your case is “Multiple Request2”.
Also, try to keep one request per tab, as that is the correct way. The collection runner exists for this purpose. I suggest you check this out for more clarity: Collections in Postman