I have several tests in my postman collection but some of them are dependent on few others from within the collection as the latter set some envt variables that are used by other tests. I want these to run in a sequence. The tests in my collection are distributed across different folders. Is there a possibility to define such a sequence in a test suite like structure?
The RUN ORDER section shows the order in which the requests shall get executed from top to the bottom. (GET->POST->DEL->PUT). Click on the Run Collection1 button. Execution Results show the GET request executed first, followed by POST, then DEL finally PUT, as specified in the RUN ORDER.
Which statements are true about Collection runner in Postman? The Collection Runner allows you to run sets of requests in a specified sequence. The Collection Runner will log your request test results, and your scripts can pass data between requests as well as altering the request workflow.
The Collection Runner enables you to run the API requests in a collection in a specified sequence. It logs your request test results and can use scripts to pass data between requests and alter the request workflow. You can configure the Collection Runner to meet your development needs.
The execution happens according to how the folders and tests within each is displayed inside Postman.
In a collection, I normally number my folders according to the execution order and then the individual tests can be prefixed with numbers as well, so that you control the execution. Refer to the attached screenshot.
Also there's a postman.setNextRequest('Request-title');
method to customize which request you want to execute next.
Source - http://blog.getpostman.com/2016/03/23/conditional-workflows-in-postman/
You can drag/drop requests in postman in order that you want to be executed in Collection Runner
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With