Different Ways of Running Postman Script

Raghwendra Sonu
2 min readSep 10, 2019

--

First Approach:
Execute from Postman Console itself.

Second Approach

Running from Command Line, Using Newman.

First install Node.js, and after that install Newman from Command Line.

npm install -g newman

Export the Postman Collection in a JSON file.

Use the command, “newman run ForMedium.postman_collection.json” to execute your imported collection.

Third Approach

Running remotely by sharing the Collection URL.

First get the collection URL, and then use this URL to run this on any other machine.

Copy the link, and goto Remote machine where you want to execute this Collection.

Launch Newman on the Remote Machine, and use below command to trigger Collection execution:

Newman run https://www.getpostman.com/collections/bfe95e9e1b825e8336b0

Fourth Approach

Through Jenkins.

For this, we need to first setup a job in Jenkins, create a free style project, and in the Build Step, add “Execute Windows Batch Command”.

Goto the folder where collection is saved: cd C:\Users\XYZ\Desktop

Run the collection:

newman run CollectionName.json

Once done, save the job and Build Now. You can also schedule the job from here for future executions.

Fifth Approach

Execute as a part of Collection. Using Collection Runner.

Let me know if this was helpful. If you ever need my help, you can write in comments sections. Also, you can contact me through my LinkedIn Profile.

--

--

Raghwendra Sonu
Raghwendra Sonu

Written by Raghwendra Sonu

Software Automation Testing expert with 9 years of work experience in diverse tools and technologies.

No responses yet