Skipping requests

in postman 7+ is it a wise move to use postman.setNextRequest(‘Request Name’) ? Is there any alternate to that using pm.* ? pm.test.skip wont suffice as i need to skip the request as a whole

Hey @SumanDas123,

Welcome to the community! :star:

Would you be able to provide some more context and an example of what you currently have in place please?

This will enable other users to visualise the problem and hopefully offer a solution. :smiley:

Sure @danny-dainton i have Request A,B,C. there is a test in request A which on certain verification will either run B or C. So far i went with the following in test scripts of request A
if(condition)
postman.setNextRequest(‘B’)
else
postman.setNextRequest(‘C’)

I was thinking whether there was any other way given i am using postman and pm together in the script. I did check that pm has not substituted the setNextRequest with an alternative yet

That seems like the correct way to me. Is it doing what you expect, given the different conditions?

That particular function hasn’t been brought into the pm.* API yet but I’m sure that it will be converted over to that in the near future. There is not harm in using that in your scripts for now.

Yes it has served the purpose. I googled for some time and I think I came across a point where @shamasis did mention somewhere of bringing about a equivalent method in the pm.* as well in postman 8. Can’t recall exactly on which thread. Would look forward to it