Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postman: Is it possible to customize the sequence of test runs in the collection runner

Tags:

postman

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?

like image 316
overflower Avatar asked Apr 11 '17 03:04

overflower


People also ask

How do I set the order on my Postman?

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?

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.

What is the use of collection runner in Postman?

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.


2 Answers

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.

enter image description here

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/

like image 55
Dinesh Kumar Avatar answered Dec 24 '22 23:12

Dinesh Kumar


You can drag/drop requests in postman in order that you want to be executed in Collection Runner

like image 39
luka martinovic Avatar answered Dec 24 '22 22:12

luka martinovic