Run Postman Collection in Jenkins

Ningrum
2 min readOct 7, 2020

--

You can run your postman collection in Jenkins, with step:

1. Create new project.

Select new item > Enter an item name “Postman Example” > Choose Freestyle project > Click OK.

Create New Freestyle Project in Jenkins

2. Setting Build Environment.

Select Configure > Choose Build Environment tab > Check Provide Node & npm bin/folder to Path

Configure Jenkins Project
Configure Jenkins’s Build Environment

3. Setting Build.

Choose Execute Windows batch command > Enter the newman command to execute your postman collection. In this example, I run JSON file in my local computer.

If you want to run postman public collection, you can change the command to be “newman run your_public_link”

Configure Jenkins’s Build

4. Setting Post-build Actions according to your needs, then click Save.

Configure Post-build Actions

If you want notify your teammate with the result of your collection execution, you can choose E-mail Notification and fill the recipients.

5. Click Build Now and see result in Console Output.

Build Jenkins’s Project
Jenkins Console Output

Here is the test result:

Test Report .HTML

If you have problems with the appearance of the report or the report format is not nice, you can update the Content Security Policy in Jenkins with command: System.setProperty(“hudson.model.DirectoryBrowserSupport.CSP”, “default-src ‘self’; style-src ‘self’ ‘unsafe-inline’;”)

Thanks for reading.

--

--

Ningrum
Ningrum

No responses yet