1

In collection I have 5 requests. In one of a request I want to script in Test tab that after getting a response to execute a request already in the collection.

I cant find references/blogs/article for accessing requests in collection. Alternatively I can write a request. But I need to set authorization logic, and other settings.

Siva Sankaran
  • 1,521
  • 4
  • 21
  • 40

1 Answers1

3

Use the below script in the request from where you want to trigger the next request. Note that request names has to be unique in a collection. Refer this link for more details

postman.setNextRequest("Request Name")

Update If you want to send a request after a single request is run, use

pm.sendRequest()

Refer this for pm.sendRequest

Note that pm.sendRequest has to include all parameters such as request URL, authentication etc., and is NOT a postman request self that is visible under a collection.

Jeeva
  • 438
  • 4
  • 12