My project structure is little complexed which means we are having many subfolders inside collection…For example…
I will have 2 requests in sub folder named test-1 and another 2 requests in another subfolder named test-2.
Like that we will have n number of subfolders inside collection.
My problem is that want to call test-1 folder requests in all other folders because it will have login token generation requests…Is it possible in postman
when tried to call a request using pm.sendRequest(“req name”)…got error
That’s not how pm.sendRequest() works, that’s an async request which has a set of arguments.
You can use pm.execution.setNextRequest('request_name') in the post response script to create a workflow - you can incorporate a level of logic to this too.
I did create a Collection with an example of how you could route requests in a certain sequence: