DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Continuous Integration and Testing Using Postman With Jenkins

Continuous Integration and Testing Using Postman With Jenkins

Using these tools in combination can create a working continuous REST API testing instance.

Saranya Shanmugam user avatar by
Saranya Shanmugam
·
May. 08, 19 · Tutorial
Like (2)
Save
Tweet
Share
23.14K Views

Join the DZone community and get the full member experience.

Join For Free

Continuous integration and testing are the key terms to integrate all the phases of the development lifecycle and deliver working product/software to a client at the earliest possible time using tools like Jenkins. Here, you will get to know about performing continuous REST API testing using Postman with Jenkins tools.

Postman is a tool used to develop, test, share, monitor the performance of an automated test and document API’s. Follow the below steps to integrate Postman with Jenkins for continuous integration and testing.

Step 1: Use this link to install Postman for Windows.  

Step 2:  Create collections in Postman.

Collections are used to create and store series of API request and can be executed altogether. I am taking a dummy REST API for creating collections in Postman.

Collections


After you create the collections in Postman, export it and save it in your local system. The exported API test collection can be executed from the Command Line Interface (CLI). Let's see how to execute the Postman collections from the CLI.

Type the below command from command line interface to install Newman, post to that installation we can able to execute collections from CLI (Command Line Interface).

npm install -g newman


Note: Ensure Node.js for windows should be available in your system to install newman. Node.js can be installed from https://nodejs.org/en/download/

Step 3: Execute Collections from Command Line Interface

From the command line interface, just go to the location where you have stored/exported collections in your local system. Use the below command to execute collections from CLI,

newman run <collection name>


Example:

 

newman run EmployeeCollection.Postman_collection.json

 

Image title


Step 4: Integrate Postman Collection with Jenkins

  • The first step is to download Jenkins from the official website
  • Type the below command to install Jenkins from the command line:
java -jar Jenkins.war


  • You can launch Jenkins using http://localhost:8086/
  • Create a Freestyle project in Jenkins
  • Image title

    Configure the build section with below command to execute Postman collections test:

    Image title


    Note: I entered 2 lines of command. The first line represents the location where we have collections saved and the second line executes collections created in Postman tool.

    Click the "Build Now" option from Jenkins to execute every command from the build section one by one and you can see your collection result from Jenkins.

    Image title


    Configure Jenkins with the Build Triggers option to trigger the build every minute automatically so that Jenkins will check the latest change from the location where you have stored the Postman collection and it triggers the build automatically.

     Image title

    Continuous Integration/Deployment Jenkins (software) Integration Command-line interface Command (computing)

    Opinions expressed by DZone contributors are their own.

    Popular on DZone

    • Connecting Your Devs' Work to the Business
    • How to Quickly Build an Audio Editor With UI
    • Using AI and Machine Learning To Create Software
    • Writing a Modern HTTP(S) Tunnel in Rust

    Comments

    Partner Resources

    X

    ABOUT US

    • About DZone
    • Send feedback
    • Careers
    • Sitemap

    ADVERTISE

    • Advertise with DZone

    CONTRIBUTE ON DZONE

    • Article Submission Guidelines
    • Become a Contributor
    • Visit the Writers' Zone

    LEGAL

    • Terms of Service
    • Privacy Policy

    CONTACT US

    • 600 Park Offices Drive
    • Suite 300
    • Durham, NC 27709
    • support@dzone.com
    • +1 (919) 678-0300

    Let's be friends: