SlideShare a Scribd company logo
Sept 11, 2019
PRESENTED BY
Testing, Automation &
Reporting with Postman
Trent McCann - Engineering Manager, Quality
Danny Dainton - Senior Quality Engineer
Speakers
Danny Dainton
Senior Quality Engineer
Trent McCann
Engineering Manager, Quality
Housekeeping
• Wifi - PostmanWIFI p/POSTCON!
• Washrooms / Beverages
• Facilitators
• Breaks
● Testing Module Part I
● Testing: Practical Exercises
● Break
● Testing Module Part II
● Testing: Practical Exercise
● Break
● Automation
● Reporting
● Workshop Wrap-up
Agenda
Prerequisites
Import Collections
1. Navigate to bit.ly/POSTCON2019WORKSHOP
2. Copy the first Collection link and open up the Postman app
3. Select the Import button at the top of the app.
4. Select Import From Link tab
5. Paste the URL into the field
6. Click Import
7. Repeat for the second link
Assumptions
This session assumes that
attendees:
● Are comfortable making Requests
in Postman
● Possess basic working knowledge
of JavaScript
● Have the Latest Postman Desktop
App Installed for your OS
Testing Concepts
Overview
What the Hell is API Testing?
● People generally think that API testing is a form of software testing
that you need to know about before getting started
● It is testing but in a different context
● You are still:
○ Using the same test skills and techniques but applying them
differently
○ Focused on mitigating risk
○ Providing information about the software under test
Why Write API Tests?
● Determine if the application under test meets expectations for
functionality, reliability, performance, and security
● Ensure consistent high quality as your application grows
● Critical component for automating testing – APIs are the primary
interface to application logic
● Tests at the API layer are less brittle and easier to maintain
● Most stable interface - GUI tests are not sufficient to validate all
functional paths of a multi-tier architecture
Scripts
• Postman contains a powerful runtime based on Node.js that allows
you to add dynamic behavior to requests and collections
• Allows you to write test suites, build requests that can contain
dynamic parameters, pass data between requests and more
• You can add JavaScript code to execute during 2 events in the flow:
• Before a request is sent to the server, under the Pre-request Script tab
• After a response is received, as a test script under the Tests tab
Execution Order of Scripts
• A Pre-request Script associated with a request will execute before the request
is sent
• A Test script associated with a request will execute after the request is sent
REQUEST
Pre-request script
REQUEST RESPONSE
REQUEST
test script
Collection and Folder Scripts
Pre-Request Scripts
• Snippets of code associated with a collection request that are executed
before the request is sent
• Example use cases:
• Including the timestamp in the request headers or
• Sending a random alphanumeric string in the URL parameters
• Can be added to a collection, a folder, or a single request within a collection
• Runs prior to each request in the respective collection or folder, allowing for
commonly used code to be executed prior to every request
Pre-Request Script Execution
For every request in a collection, scripts will execute in the following order:
• A pre-request script associated with a collection or folder will run prior to every
request in the respective collection or folder
REQUEST
Pre-request script
REQUEST
FOLDER
Pre-request script
COLLECTION
Pre-request script
Practical
Exercise:
Pre-Request
Scripts
1. Click on the New button
2. Select Request
3. Enter a Request Name
4. Create Collection and enter name
Steps
5. Enter URL https://postman-echo.com/get
and hit Send
6. Click on Gear Icon
7. Click on the Add button
8. Enter a name and click Add
9. Select Environment from Dropdown
10. Select the Pre-request Script tab
11. Type:
pm.environment.set("dateTime", new Date());
12. Select the Params tab
13. Enter “date” for the key
and “{{dateTime}}” for the value.
Steps
14. Hit Send
Test Scripts
● JavaScript code executed after the request is sent, allowing
access to the pm.response object.
● Tests run in a sandboxed environment, which is separate
from the execution environment of the app
● Commonly used snippets are listed next to the editor and are
a great way to build test cases
○ Select the snippet you want to add and the appropriate
code will populate in the test editor
For every request in a collection, scripts will execute in the following order:
• A test script associated with a collection or folder will run after every request in the
respective collection or folder
RESPONSE
COLLECTION
test script
FOLDER
test script
REQUEST
test script
Test Script Execution
Practical
Exercise:
Test Scripts
1. Select the Tests tab
2. Select Status Code: Code is 200 Snippet
3. Select Response Time is less than
200ms Snippet
4. Edit 200ms to 100ms
Steps
6. Select Test Results tab
5. Hit Send
7. Highlight and Cut the Tests from Request
8. Save Changes to the Request
9. Edit the Collection
10. Select Tests tab
Steps
12. Hit Send
11. Paste Tests and click Update
Break Time
Level Up Your Testing In
Postman
What do we mean by
advanced techniques?
Dynamic Variables
● Postman has dynamic variables that can be used in requests
● Values are randomly generated during the request/collection run
● Established variables {{$randomInt}}, {{$timestamp}} and
{{$guid}} have been included for many versions
● Random fake data can be generated using a subset of the FakerJS
functions
● Can used in the URL, Headers, Request Body and also within Mock
Server Examples
Chai Assertions
• Using the popular and well known Chai.js library
• Chai provides natural language assertions in an
expressive and readable style
• Chained together by a series of getters
• be / been / is / and / has / have / not
• Works with the pm.expect() function
• The assertion always starts with the .to getter
Built-In Libraries
• Lodash: JS utility library
• Moment: Parse, validate, manipulate, and display dates and
times in JavaScript.
• Cheerio: A fast, lean implementation of the core jQuery API
• Ajv: JSON schema validator.
• CryptoJS: Standard and secure cryptographic algorithms.
• xml2Json: Simple XML to JSON Convertor.
Postman Console
• Debugging scripts can be written under either
the Pre-request Script tab or the Tests tab,
with helpful messages logged in the Postman
Console.
• The Postman Console is analogous to a
browser’s version of Developer console,
except that it’s tuned for API development.
• If an API or API test is not behaving as you
expect, this would be the place where you will
go to deep dive while debugging the same.
● The Postman Console can be compared to a browser’s
Developer console, but tuned for API development
● When debug scripts are written under the Pre-request Script
or Test tabs, helpful messages will be logged in the Postman
Console
● If an API or API test is not behaving as expected, the console
will assist with debugging
What Does it Do?
• Logs the request that was sent, including all the underlying
request headers, status code etc.
• Logs the exact response sent by the server
• Displays what proxy and certificates were used for the
request
• Shows error logs from Test or Pre-request Scripts
• Allows the console.log() statement to be used from inside
sandbox
Console.log();
Your New
Best Friend
• JS method used to write
messages to the debug
console
• Can be used for debugging
your test scripts and
capturing key information
from the test runs
Practical
Exercise:
Advanced
Techniques
Module
Review
Break Time
Automation Made Easy
Overview
Collection Runner
• Collections are groups of requests that can be run together as a series of requests, against a corresponding
environment.
• Running a collection is useful when you want to automate API testing. When you run a collection, you send all
requests in your collection one after another.
• When you use scripts, you can build integration test suites, pass data between API requests, and build workflows
that mirror your actual use case of APIs.
● Collections are groups of requests that can be run together as a
series, against a corresponding environment
● Enables automation of API test collections
● When a collection is run, all requests in the collection will be sent
one after another
● Using scripts allows you to:
○ Build integration test suites
○ Pass data between API requests
○ Build workflows that mirror API use cases
Practical
Exercise:
Collection
Runner
Steps
1. Navigate to the Collections tab
2. Click on the Navigation arrow and hit Run
3. Click on the Run “collection name” button
4. Run Results
5. Click on request name
Meet
Newman
What is Newman?
● A globally installed NPM package
● A Collection Runner for Postman that runs directly from the
command line
● Easily integrates with continuous integration servers and build
systems
● Maintains feature parity with the Postman App
● Allows Collections to be run the way they are executed in the
Postman app collection runner
● Built as a library - can be extended and used flexibly
● Collection run reports can be generated using different
custom reporters
newman run -h
Newman In Action
CI/CD • Newman can run on
popular CI/CD frameworks
such as Jenkins, Travis,
CircleCI and even Azure
(via VSTS).
• Provides a streamlined
way to run Newman in a
Docker container without
operating system
dependencies or
environment setup
Newman + Jenkins Demo
Module
Review
Break Time
Reporting: “And that’s
the way it is.”
Overview
Why Do We Create Reports?
Reports are generally created to communicate information to some
person, The type of report and the details about what it should contain,
will differ from person to person.
Things to consider when creating reports:
● The report's intended audience
● The report's purpose
● The type of information to be communicated
Reporters Created By
Postman
Standard Newman Reporters
CLI
This is the default reporter that comes with Newman and is the standard
output that you will see. There are a number of different configurable
options/cli arguments available to present that out in specific ways.
JUNIT
This reporter will create an XML file containing the all high level test
result data, this can be picked by CI tools like Jenkins to display a
graphical representation of the overall test coverage
PROGRESS [=======]
EMOJITRAIN
😀😀😀😍
Reporters Created By The
Postman Community
NPM Packages
StatsD
Slack
A new take on a modern classic...
HTMLEXTRA Report
bit.ly/newmanhtmlextra
Postman HTML
Report
bit.ly/newmanhtml
Module
Review
Review
● Testing within Postman can be an effective way to give you confidence that
your API endpoints are returning the correct information without having to
manually confirm this on each request
● Postman is packed full of different helpers, libraries and utilities that can
enable you to create more complex test suites
● Automating a Collection within the App is super simple using the Built In
Runner
● You can use Newman to run your Collections from either the Command
Line or easily integrate into your CI systems
Recommended Resources
● Postman Community - https://community.getpostman.com
● Learning Centre - https://learning.getpostman.com
● GitHub Repo - https://github.com/postmanlabs/postman-app-support
● Support Portal - https://support.getpostman.com/hc
Trent
ca/linkedin.com/in/trentmccann
@Postman_Trent
Danny
uk/linkedin.com/in/dannydainton
@DannyDainton
Keep In Touch!
Workshop Resources
bit.ly/POSTCON2019WORKSHOP
Thank You and Goodbye

More Related Content

What's hot

Postman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman: An Introduction for Developers
Postman: An Introduction for Developers
Postman
 
Accelerate Quality with Postman - Basics
Accelerate Quality with Postman - BasicsAccelerate Quality with Postman - Basics
Accelerate Quality with Postman - Basics
Knoldus Inc.
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
Bruno Pedro
 
API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
Pricilla Bilavendran
 
Postman Webinar: Postman 101
Postman Webinar: Postman 101Postman Webinar: Postman 101
Postman Webinar: Postman 101
Nikita Sharma
 
Webinar: Postman 101 for Developers
Webinar: Postman 101 for DevelopersWebinar: Postman 101 for Developers
Webinar: Postman 101 for Developers
Postman
 
Postman 101 & Office Hours
Postman 101 & Office HoursPostman 101 & Office Hours
Postman 101 & Office Hours
Postman
 
Postman
PostmanPostman
API Testing
API TestingAPI Testing
API Testing
Bikash Sharma
 
Postman An Introduction for Testers, October 26 2022.pptx
Postman An Introduction for Testers, October 26 2022.pptxPostman An Introduction for Testers, October 26 2022.pptx
Postman An Introduction for Testers, October 26 2022.pptx
Postman
 
Api Testing
Api TestingApi Testing
Api Testing
Vishwanath KC
 
Api testing
Api testingApi testing
Api testing
HamzaMajid13
 
Postman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman: An Introduction for Developers
Postman: An Introduction for Developers
Postman
 
Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”
Postman
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
TEST Huddle
 
Postman Introduction
Postman IntroductionPostman Introduction
Postman Introduction
Rahul Agarwal
 
Space Camp :: API Lifecycle, Part I: Build and Test an API
Space Camp :: API Lifecycle, Part I: Build and Test an APISpace Camp :: API Lifecycle, Part I: Build and Test an API
Space Camp :: API Lifecycle, Part I: Build and Test an API
Postman
 
B4USolution_API-Testing
B4USolution_API-TestingB4USolution_API-Testing
B4USolution_API-Testing
b4usolution .
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
Siddharth Sharma
 
Space Camp June 2022 - API First.pdf
Space Camp June 2022 - API First.pdfSpace Camp June 2022 - API First.pdf
Space Camp June 2022 - API First.pdf
Postman
 

What's hot (20)

Postman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman: An Introduction for Developers
Postman: An Introduction for Developers
 
Accelerate Quality with Postman - Basics
Accelerate Quality with Postman - BasicsAccelerate Quality with Postman - Basics
Accelerate Quality with Postman - Basics
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
 
API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
 
Postman Webinar: Postman 101
Postman Webinar: Postman 101Postman Webinar: Postman 101
Postman Webinar: Postman 101
 
Webinar: Postman 101 for Developers
Webinar: Postman 101 for DevelopersWebinar: Postman 101 for Developers
Webinar: Postman 101 for Developers
 
Postman 101 & Office Hours
Postman 101 & Office HoursPostman 101 & Office Hours
Postman 101 & Office Hours
 
Postman
PostmanPostman
Postman
 
API Testing
API TestingAPI Testing
API Testing
 
Postman An Introduction for Testers, October 26 2022.pptx
Postman An Introduction for Testers, October 26 2022.pptxPostman An Introduction for Testers, October 26 2022.pptx
Postman An Introduction for Testers, October 26 2022.pptx
 
Api Testing
Api TestingApi Testing
Api Testing
 
Api testing
Api testingApi testing
Api testing
 
Postman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman: An Introduction for Developers
Postman: An Introduction for Developers
 
Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
 
Postman Introduction
Postman IntroductionPostman Introduction
Postman Introduction
 
Space Camp :: API Lifecycle, Part I: Build and Test an API
Space Camp :: API Lifecycle, Part I: Build and Test an APISpace Camp :: API Lifecycle, Part I: Build and Test an API
Space Camp :: API Lifecycle, Part I: Build and Test an API
 
B4USolution_API-Testing
B4USolution_API-TestingB4USolution_API-Testing
B4USolution_API-Testing
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
 
Space Camp June 2022 - API First.pdf
Space Camp June 2022 - API First.pdfSpace Camp June 2022 - API First.pdf
Space Camp June 2022 - API First.pdf
 

Similar to POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with Postman

PAC 2019 virtual Bruno Audoux
PAC 2019 virtual Bruno Audoux PAC 2019 virtual Bruno Audoux
PAC 2019 virtual Bruno Audoux
Neotys
 
Selenium Training in Chennai
Selenium Training in ChennaiSelenium Training in Chennai
Selenium Training in Chennai
Thecreating Experts
 
Functional Testing of RESTful Applications
Functional Testing of RESTful ApplicationsFunctional Testing of RESTful Applications
Functional Testing of RESTful Applications
Nenad Bozic
 
Measuring IPv6 using ad-based measurement
Measuring IPv6 using ad-based measurementMeasuring IPv6 using ad-based measurement
Measuring IPv6 using ad-based measurement
APNIC
 
Getting Started with Selenium
Getting Started with SeleniumGetting Started with Selenium
Getting Started with Selenium
Dave Haeffner
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
Mihai-Cristian Fratila
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lesson
Sadaaki Emura
 
Integration Testing as Validation and Monitoring
 Integration Testing as Validation and Monitoring Integration Testing as Validation and Monitoring
Integration Testing as Validation and Monitoring
Melissa Benua
 
AWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for Developers
Amazon Web Services
 
Continuous Integration, Deploy, Test From Beginning To End 2014
Continuous Integration, Deploy, Test From Beginning To End 2014Continuous Integration, Deploy, Test From Beginning To End 2014
Continuous Integration, Deploy, Test From Beginning To End 2014
Clever Moe
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Dave Haeffner
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
Rogue Wave Software
 
Continuous Integration using Jenkins with Python
Continuous Integration using Jenkins with PythonContinuous Integration using Jenkins with Python
Continuous Integration using Jenkins with Python
Inexture Solutions
 
SRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver FasterSRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver Faster
Amazon Web Services
 
AWS Atlanta meetup Build Tools - Code Commit, Code Build, Code Deploy
AWS Atlanta meetup Build Tools - Code Commit, Code Build, Code DeployAWS Atlanta meetup Build Tools - Code Commit, Code Build, Code Deploy
AWS Atlanta meetup Build Tools - Code Commit, Code Build, Code Deploy
Adam Book
 
Hudson
HudsonHudson
Hudson
8x8
 
Continuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 MedellinContinuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 Medellin
Diego Garber
 
Jenkins_1679702972.pdf
Jenkins_1679702972.pdfJenkins_1679702972.pdf
Jenkins_1679702972.pdf
MahmoudAlnmr1
 
jenkins.pdf
jenkins.pdfjenkins.pdf
jenkins.pdf
shahidafrith
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsTYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
Michael Lihs
 

Similar to POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with Postman (20)

PAC 2019 virtual Bruno Audoux
PAC 2019 virtual Bruno Audoux PAC 2019 virtual Bruno Audoux
PAC 2019 virtual Bruno Audoux
 
Selenium Training in Chennai
Selenium Training in ChennaiSelenium Training in Chennai
Selenium Training in Chennai
 
Functional Testing of RESTful Applications
Functional Testing of RESTful ApplicationsFunctional Testing of RESTful Applications
Functional Testing of RESTful Applications
 
Measuring IPv6 using ad-based measurement
Measuring IPv6 using ad-based measurementMeasuring IPv6 using ad-based measurement
Measuring IPv6 using ad-based measurement
 
Getting Started with Selenium
Getting Started with SeleniumGetting Started with Selenium
Getting Started with Selenium
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lesson
 
Integration Testing as Validation and Monitoring
 Integration Testing as Validation and Monitoring Integration Testing as Validation and Monitoring
Integration Testing as Validation and Monitoring
 
AWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for Developers
 
Continuous Integration, Deploy, Test From Beginning To End 2014
Continuous Integration, Deploy, Test From Beginning To End 2014Continuous Integration, Deploy, Test From Beginning To End 2014
Continuous Integration, Deploy, Test From Beginning To End 2014
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
Continuous Integration using Jenkins with Python
Continuous Integration using Jenkins with PythonContinuous Integration using Jenkins with Python
Continuous Integration using Jenkins with Python
 
SRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver FasterSRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver Faster
 
AWS Atlanta meetup Build Tools - Code Commit, Code Build, Code Deploy
AWS Atlanta meetup Build Tools - Code Commit, Code Build, Code DeployAWS Atlanta meetup Build Tools - Code Commit, Code Build, Code Deploy
AWS Atlanta meetup Build Tools - Code Commit, Code Build, Code Deploy
 
Hudson
HudsonHudson
Hudson
 
Continuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 MedellinContinuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 Medellin
 
Jenkins_1679702972.pdf
Jenkins_1679702972.pdfJenkins_1679702972.pdf
Jenkins_1679702972.pdf
 
jenkins.pdf
jenkins.pdfjenkins.pdf
jenkins.pdf
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsTYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
 

More from Postman

Elevating Developer Experiences with AI-Powered API Testing & Documentation
Elevating Developer Experiences with AI-Powered API Testing & DocumentationElevating Developer Experiences with AI-Powered API Testing & Documentation
Elevating Developer Experiences with AI-Powered API Testing & Documentation
Postman
 
Discovering Public APIs and Public API Network with Postman
Discovering Public APIs and Public API Network with PostmanDiscovering Public APIs and Public API Network with Postman
Discovering Public APIs and Public API Network with Postman
Postman
 
Optimizing Teamwork: Harnessing Collections & Workspaces for Collaboration
Optimizing Teamwork: Harnessing Collections & Workspaces for CollaborationOptimizing Teamwork: Harnessing Collections & Workspaces for Collaboration
Optimizing Teamwork: Harnessing Collections & Workspaces for Collaboration
Postman
 
API testing Beyond the Basics AI & Automation Techniques
API testing Beyond the Basics AI & Automation TechniquesAPI testing Beyond the Basics AI & Automation Techniques
API testing Beyond the Basics AI & Automation Techniques
Postman
 
Not Your Grandma’s Rate Limiting (slides)
Not Your Grandma’s Rate Limiting (slides)Not Your Grandma’s Rate Limiting (slides)
Not Your Grandma’s Rate Limiting (slides)
Postman
 
Five Ways to Automate API Testing with Postman
Five Ways to Automate API Testing with PostmanFive Ways to Automate API Testing with Postman
Five Ways to Automate API Testing with Postman
Postman
 
How to Scale APIs-as-Product for Future Success
How to Scale APIs-as-Product for Future SuccessHow to Scale APIs-as-Product for Future Success
How to Scale APIs-as-Product for Future Success
Postman
 
Revolutionizing API Development: Collaborative Workflows with Postman
Revolutionizing API Development: Collaborative Workflows with PostmanRevolutionizing API Development: Collaborative Workflows with Postman
Revolutionizing API Development: Collaborative Workflows with Postman
Postman
 
Everything You Always Wanted to Know About AsyncAPI
Everything You Always Wanted to Know About AsyncAPIEverything You Always Wanted to Know About AsyncAPI
Everything You Always Wanted to Know About AsyncAPI
Postman
 
Elevating Event-Driven World: A Deep Dive into AsyncAPI v3
Elevating Event-Driven World: A Deep Dive into AsyncAPI v3Elevating Event-Driven World: A Deep Dive into AsyncAPI v3
Elevating Event-Driven World: A Deep Dive into AsyncAPI v3
Postman
 
Five Things You SHOULD Know About Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman
 
Integration-, Snapshot- and Performance-Testing APIs
Integration-, Snapshot- and Performance-Testing APIs Integration-, Snapshot- and Performance-Testing APIs
Integration-, Snapshot- and Performance-Testing APIs
Postman
 
How ChatGPT led OpenAPI's Recent Spike in Popularity
How ChatGPT led OpenAPI's Recent Spike in PopularityHow ChatGPT led OpenAPI's Recent Spike in Popularity
How ChatGPT led OpenAPI's Recent Spike in Popularity
Postman
 
Exploring Postman’s VS Code Extension
Exploring Postman’s VS Code ExtensionExploring Postman’s VS Code Extension
Exploring Postman’s VS Code Extension
Postman
 
2023 State of the API Report: Key Findings and Trends
2023 State of the API Report: Key Findings and Trends2023 State of the API Report: Key Findings and Trends
2023 State of the API Report: Key Findings and Trends
Postman
 
Nordic- APIOps is here What will you build in an API First World
Nordic- APIOps is here What will you build in an API First World Nordic- APIOps is here What will you build in an API First World
Nordic- APIOps is here What will you build in an API First World
Postman
 
Testing and Developing gRPC APIs
Testing and Developing gRPC APIsTesting and Developing gRPC APIs
Testing and Developing gRPC APIs
Postman
 
Testing and Developing GraphQL APIs
Testing and Developing GraphQL APIsTesting and Developing GraphQL APIs
Testing and Developing GraphQL APIs
Postman
 
Introduction to API Security - Intergalactic
Introduction to API Security - IntergalacticIntroduction to API Security - Intergalactic
Introduction to API Security - Intergalactic
Postman
 
Unboxing What's New in Postman Q2
Unboxing What's New in Postman Q2Unboxing What's New in Postman Q2
Unboxing What's New in Postman Q2
Postman
 

More from Postman (20)

Elevating Developer Experiences with AI-Powered API Testing & Documentation
Elevating Developer Experiences with AI-Powered API Testing & DocumentationElevating Developer Experiences with AI-Powered API Testing & Documentation
Elevating Developer Experiences with AI-Powered API Testing & Documentation
 
Discovering Public APIs and Public API Network with Postman
Discovering Public APIs and Public API Network with PostmanDiscovering Public APIs and Public API Network with Postman
Discovering Public APIs and Public API Network with Postman
 
Optimizing Teamwork: Harnessing Collections & Workspaces for Collaboration
Optimizing Teamwork: Harnessing Collections & Workspaces for CollaborationOptimizing Teamwork: Harnessing Collections & Workspaces for Collaboration
Optimizing Teamwork: Harnessing Collections & Workspaces for Collaboration
 
API testing Beyond the Basics AI & Automation Techniques
API testing Beyond the Basics AI & Automation TechniquesAPI testing Beyond the Basics AI & Automation Techniques
API testing Beyond the Basics AI & Automation Techniques
 
Not Your Grandma’s Rate Limiting (slides)
Not Your Grandma’s Rate Limiting (slides)Not Your Grandma’s Rate Limiting (slides)
Not Your Grandma’s Rate Limiting (slides)
 
Five Ways to Automate API Testing with Postman
Five Ways to Automate API Testing with PostmanFive Ways to Automate API Testing with Postman
Five Ways to Automate API Testing with Postman
 
How to Scale APIs-as-Product for Future Success
How to Scale APIs-as-Product for Future SuccessHow to Scale APIs-as-Product for Future Success
How to Scale APIs-as-Product for Future Success
 
Revolutionizing API Development: Collaborative Workflows with Postman
Revolutionizing API Development: Collaborative Workflows with PostmanRevolutionizing API Development: Collaborative Workflows with Postman
Revolutionizing API Development: Collaborative Workflows with Postman
 
Everything You Always Wanted to Know About AsyncAPI
Everything You Always Wanted to Know About AsyncAPIEverything You Always Wanted to Know About AsyncAPI
Everything You Always Wanted to Know About AsyncAPI
 
Elevating Event-Driven World: A Deep Dive into AsyncAPI v3
Elevating Event-Driven World: A Deep Dive into AsyncAPI v3Elevating Event-Driven World: A Deep Dive into AsyncAPI v3
Elevating Event-Driven World: A Deep Dive into AsyncAPI v3
 
Five Things You SHOULD Know About Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
 
Integration-, Snapshot- and Performance-Testing APIs
Integration-, Snapshot- and Performance-Testing APIs Integration-, Snapshot- and Performance-Testing APIs
Integration-, Snapshot- and Performance-Testing APIs
 
How ChatGPT led OpenAPI's Recent Spike in Popularity
How ChatGPT led OpenAPI's Recent Spike in PopularityHow ChatGPT led OpenAPI's Recent Spike in Popularity
How ChatGPT led OpenAPI's Recent Spike in Popularity
 
Exploring Postman’s VS Code Extension
Exploring Postman’s VS Code ExtensionExploring Postman’s VS Code Extension
Exploring Postman’s VS Code Extension
 
2023 State of the API Report: Key Findings and Trends
2023 State of the API Report: Key Findings and Trends2023 State of the API Report: Key Findings and Trends
2023 State of the API Report: Key Findings and Trends
 
Nordic- APIOps is here What will you build in an API First World
Nordic- APIOps is here What will you build in an API First World Nordic- APIOps is here What will you build in an API First World
Nordic- APIOps is here What will you build in an API First World
 
Testing and Developing gRPC APIs
Testing and Developing gRPC APIsTesting and Developing gRPC APIs
Testing and Developing gRPC APIs
 
Testing and Developing GraphQL APIs
Testing and Developing GraphQL APIsTesting and Developing GraphQL APIs
Testing and Developing GraphQL APIs
 
Introduction to API Security - Intergalactic
Introduction to API Security - IntergalacticIntroduction to API Security - Intergalactic
Introduction to API Security - Intergalactic
 
Unboxing What's New in Postman Q2
Unboxing What's New in Postman Q2Unboxing What's New in Postman Q2
Unboxing What's New in Postman Q2
 

Recently uploaded

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 

Recently uploaded (20)

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 

POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with Postman

  • 1. Sept 11, 2019 PRESENTED BY Testing, Automation & Reporting with Postman Trent McCann - Engineering Manager, Quality Danny Dainton - Senior Quality Engineer
  • 2. Speakers Danny Dainton Senior Quality Engineer Trent McCann Engineering Manager, Quality
  • 3. Housekeeping • Wifi - PostmanWIFI p/POSTCON! • Washrooms / Beverages • Facilitators • Breaks
  • 4. ● Testing Module Part I ● Testing: Practical Exercises ● Break ● Testing Module Part II ● Testing: Practical Exercise ● Break ● Automation ● Reporting ● Workshop Wrap-up Agenda
  • 6. Import Collections 1. Navigate to bit.ly/POSTCON2019WORKSHOP 2. Copy the first Collection link and open up the Postman app 3. Select the Import button at the top of the app. 4. Select Import From Link tab 5. Paste the URL into the field 6. Click Import 7. Repeat for the second link
  • 7. Assumptions This session assumes that attendees: ● Are comfortable making Requests in Postman ● Possess basic working knowledge of JavaScript ● Have the Latest Postman Desktop App Installed for your OS
  • 10. What the Hell is API Testing? ● People generally think that API testing is a form of software testing that you need to know about before getting started ● It is testing but in a different context ● You are still: ○ Using the same test skills and techniques but applying them differently ○ Focused on mitigating risk ○ Providing information about the software under test
  • 11. Why Write API Tests? ● Determine if the application under test meets expectations for functionality, reliability, performance, and security ● Ensure consistent high quality as your application grows ● Critical component for automating testing – APIs are the primary interface to application logic ● Tests at the API layer are less brittle and easier to maintain ● Most stable interface - GUI tests are not sufficient to validate all functional paths of a multi-tier architecture
  • 12. Scripts • Postman contains a powerful runtime based on Node.js that allows you to add dynamic behavior to requests and collections • Allows you to write test suites, build requests that can contain dynamic parameters, pass data between requests and more • You can add JavaScript code to execute during 2 events in the flow: • Before a request is sent to the server, under the Pre-request Script tab • After a response is received, as a test script under the Tests tab
  • 13. Execution Order of Scripts • A Pre-request Script associated with a request will execute before the request is sent • A Test script associated with a request will execute after the request is sent REQUEST Pre-request script REQUEST RESPONSE REQUEST test script
  • 15. Pre-Request Scripts • Snippets of code associated with a collection request that are executed before the request is sent • Example use cases: • Including the timestamp in the request headers or • Sending a random alphanumeric string in the URL parameters • Can be added to a collection, a folder, or a single request within a collection • Runs prior to each request in the respective collection or folder, allowing for commonly used code to be executed prior to every request
  • 16. Pre-Request Script Execution For every request in a collection, scripts will execute in the following order: • A pre-request script associated with a collection or folder will run prior to every request in the respective collection or folder REQUEST Pre-request script REQUEST FOLDER Pre-request script COLLECTION Pre-request script
  • 18. 1. Click on the New button 2. Select Request 3. Enter a Request Name 4. Create Collection and enter name Steps 5. Enter URL https://postman-echo.com/get and hit Send 6. Click on Gear Icon 7. Click on the Add button 8. Enter a name and click Add 9. Select Environment from Dropdown
  • 19. 10. Select the Pre-request Script tab 11. Type: pm.environment.set("dateTime", new Date()); 12. Select the Params tab 13. Enter “date” for the key and “{{dateTime}}” for the value. Steps 14. Hit Send
  • 20. Test Scripts ● JavaScript code executed after the request is sent, allowing access to the pm.response object. ● Tests run in a sandboxed environment, which is separate from the execution environment of the app ● Commonly used snippets are listed next to the editor and are a great way to build test cases ○ Select the snippet you want to add and the appropriate code will populate in the test editor
  • 21. For every request in a collection, scripts will execute in the following order: • A test script associated with a collection or folder will run after every request in the respective collection or folder RESPONSE COLLECTION test script FOLDER test script REQUEST test script Test Script Execution
  • 23. 1. Select the Tests tab 2. Select Status Code: Code is 200 Snippet 3. Select Response Time is less than 200ms Snippet 4. Edit 200ms to 100ms Steps 6. Select Test Results tab 5. Hit Send
  • 24. 7. Highlight and Cut the Tests from Request 8. Save Changes to the Request 9. Edit the Collection 10. Select Tests tab Steps 12. Hit Send 11. Paste Tests and click Update
  • 26. Level Up Your Testing In Postman
  • 27. What do we mean by advanced techniques?
  • 28. Dynamic Variables ● Postman has dynamic variables that can be used in requests ● Values are randomly generated during the request/collection run ● Established variables {{$randomInt}}, {{$timestamp}} and {{$guid}} have been included for many versions ● Random fake data can be generated using a subset of the FakerJS functions ● Can used in the URL, Headers, Request Body and also within Mock Server Examples
  • 29. Chai Assertions • Using the popular and well known Chai.js library • Chai provides natural language assertions in an expressive and readable style • Chained together by a series of getters • be / been / is / and / has / have / not • Works with the pm.expect() function • The assertion always starts with the .to getter
  • 30. Built-In Libraries • Lodash: JS utility library • Moment: Parse, validate, manipulate, and display dates and times in JavaScript. • Cheerio: A fast, lean implementation of the core jQuery API • Ajv: JSON schema validator. • CryptoJS: Standard and secure cryptographic algorithms. • xml2Json: Simple XML to JSON Convertor.
  • 31. Postman Console • Debugging scripts can be written under either the Pre-request Script tab or the Tests tab, with helpful messages logged in the Postman Console. • The Postman Console is analogous to a browser’s version of Developer console, except that it’s tuned for API development. • If an API or API test is not behaving as you expect, this would be the place where you will go to deep dive while debugging the same. ● The Postman Console can be compared to a browser’s Developer console, but tuned for API development ● When debug scripts are written under the Pre-request Script or Test tabs, helpful messages will be logged in the Postman Console ● If an API or API test is not behaving as expected, the console will assist with debugging
  • 32. What Does it Do? • Logs the request that was sent, including all the underlying request headers, status code etc. • Logs the exact response sent by the server • Displays what proxy and certificates were used for the request • Shows error logs from Test or Pre-request Scripts • Allows the console.log() statement to be used from inside sandbox
  • 33. Console.log(); Your New Best Friend • JS method used to write messages to the debug console • Can be used for debugging your test scripts and capturing key information from the test runs
  • 39. Collection Runner • Collections are groups of requests that can be run together as a series of requests, against a corresponding environment. • Running a collection is useful when you want to automate API testing. When you run a collection, you send all requests in your collection one after another. • When you use scripts, you can build integration test suites, pass data between API requests, and build workflows that mirror your actual use case of APIs. ● Collections are groups of requests that can be run together as a series, against a corresponding environment ● Enables automation of API test collections ● When a collection is run, all requests in the collection will be sent one after another ● Using scripts allows you to: ○ Build integration test suites ○ Pass data between API requests ○ Build workflows that mirror API use cases
  • 41. Steps 1. Navigate to the Collections tab 2. Click on the Navigation arrow and hit Run 3. Click on the Run “collection name” button 4. Run Results 5. Click on request name
  • 43. What is Newman? ● A globally installed NPM package ● A Collection Runner for Postman that runs directly from the command line ● Easily integrates with continuous integration servers and build systems ● Maintains feature parity with the Postman App ● Allows Collections to be run the way they are executed in the Postman app collection runner ● Built as a library - can be extended and used flexibly ● Collection run reports can be generated using different custom reporters
  • 46.
  • 47.
  • 48.
  • 49. CI/CD • Newman can run on popular CI/CD frameworks such as Jenkins, Travis, CircleCI and even Azure (via VSTS). • Provides a streamlined way to run Newman in a Docker container without operating system dependencies or environment setup
  • 55. Why Do We Create Reports? Reports are generally created to communicate information to some person, The type of report and the details about what it should contain, will differ from person to person. Things to consider when creating reports: ● The report's intended audience ● The report's purpose ● The type of information to be communicated
  • 57. Standard Newman Reporters CLI This is the default reporter that comes with Newman and is the standard output that you will see. There are a number of different configurable options/cli arguments available to present that out in specific ways. JUNIT This reporter will create an XML file containing the all high level test result data, this can be picked by CI tools like Jenkins to display a graphical representation of the overall test coverage
  • 60. Reporters Created By The Postman Community
  • 63. Slack
  • 64. A new take on a modern classic... HTMLEXTRA Report bit.ly/newmanhtmlextra Postman HTML Report bit.ly/newmanhtml
  • 66. Review ● Testing within Postman can be an effective way to give you confidence that your API endpoints are returning the correct information without having to manually confirm this on each request ● Postman is packed full of different helpers, libraries and utilities that can enable you to create more complex test suites ● Automating a Collection within the App is super simple using the Built In Runner ● You can use Newman to run your Collections from either the Command Line or easily integrate into your CI systems
  • 67. Recommended Resources ● Postman Community - https://community.getpostman.com ● Learning Centre - https://learning.getpostman.com ● GitHub Repo - https://github.com/postmanlabs/postman-app-support ● Support Portal - https://support.getpostman.com/hc Trent ca/linkedin.com/in/trentmccann @Postman_Trent Danny uk/linkedin.com/in/dannydainton @DannyDainton Keep In Touch!
  • 69. Thank You and Goodbye