API Testing with Postman
Postman is a powerful tool used to test web services and APIs. It allows you to create a request with the required HTTP method and parameters, submit the request, and inspect the results.
This course will use the Postman testing tool to teach you API testing. You will use Postman to find bugs and aid in efficient API development. Create requests and building simple workflows with Postman. Additionally, it will show you how to set up test suites in Postman that can be re-used for regression testing as a project grows.
By the end of this course, you will be able to write automated API tests and have a good grasp of how to test an API. You will know how to use Postman as you work with APIs in various capacities and you will have confidence in your ability to take part in creating high-quality APIs.
About the Author
Dave Westerveld is test developer with many years of testing experience. He has been involved in the testing of many different projects ranging from well-established products to helping with the early stages of major new initiatives. He excels at solving automation problems in a team environment and has been involved in traditional automation initiatives at various stages. Dave has also helped to improve product quality through the creative use of automation tools and by helping build out automation frameworks. He has a desire to see teams efficiently producing high-value software and is enthusiastic about understanding the way that automation tools can be used to help with this goal.
Currently, Dave works as a test developer at D2L, owner of the world’s first integrated learning platform. In this role, he has had the opportunity to learn a lot about services-based architecture and how to test them in the real world. As an employee at an educational company, Dave has a passion for sharing what he has learned with others. He is also passionate about the importance of producing good quality software and so is excited to be able to author courses that allow him to share some of his testing knowledge.
Getting Started with API Testing
This video will give you an overview about the course.
Gain a conceptual understanding of what web service is and how you can interact with them via APIs.
Explain how to think of web services as a black box function
Explain how an API can be thought of as inputs and outputs to the function
Show how it works in postman and explain JSON data
Gain an understand of how to go about figuring out API options.
Talk about the sources of information in mapping an API
Discuss about strategies that can be used to figure out how an application works
Share my journey through this process
Show how to use Postman with Auth bearer tokens.
Show how to setup a token in GitHub
Observe how to use the token in Postman to authorize delete actions
Explore how to use your username and password in Postman to do the same thing
Understand what things are important to consider when mitigating risk in API testing
Talk about risks that are greater in API testing
Mention some strategies to mitigate these risks
Encourage viewer’s to think this through with their own applications
Hands-On API Testing with Postman
Get some hands-on API testing challenges installed locally.
Get setup on GitHub
Clone the testing challenge repo locally
Install the testing challenges locally
Learn some of the risk factors and approaches to consider when testing GET calls.
Show examples of checking for internal consistency in an API
Discuss a few other examples of GET testing
Summarize some approach to use in GET testing
Understand different kinds of parameters used in APIs and how to use them in Postman.
Show examples of query parameters
Explore an example of path parameters
Discuss header and request body parameters
Learn how to use the testing challenge to gain real-life experience exploring an API.
Show how to start the testing challenge locally
Access it from Postman
Introduce the challenge to solve
See how to solve the testing challenge.
Give a hint for those that might be stuck
Walk through the solution
Explain the importance and implication of this
Testing Your API Calls
Understand how to test POST calls in an API.
Introduction to considerations in testing POST calls
Walk through an example of sending POST calls
Show an example of a POST call causing interesting issues
Understand how to test PUT calls in an API.
Discuss some of the considerations specific to PUT calls
Show examples of using PUT calls
Discuss a possible security issue shown in a PUT call
Understand how to test DELETE calls in an API.
Explain the importance of testing DELETE calls
Show examples of using DELETE calls
Summarize the API calls we have covered
Introduce a hands-on testing challenge that will use everything covered in the course up until now.
Explain the need for all types of API calls
Show how to start the challenge
Reset the project if things go wrong
Walk through the solution of the testing challenge.
Explain the purpose of this exercise
Show the first example of a 500 error
Show the second 500 error
Automating API Tests in Postman
Understand how to structure and organize test automation so that it is understandable and maintainable.
Introduce why this organization is important in test automation
Walk through the options that Postman collections have
Show an example of setting up a variable
Show how to check that an API is returning expected results.
Set up a request
Add a check on the test tab of the request
Demonstrate sharing tests between requests at the collection level
Teach users about a way that Postman enables, the sharing of code, and variables between various parts of the system.
Discuss the importance of sharing repeated items in test automation
Show how to share code with environments
Share an example of a pre-request script
Gain an understanding of how mocks work and how to use them from within Postman.
Demonstrate creating a mock
Setup an example for the mock
Discuss ways that the mock can be used to help testing
Learn how to run Postman from the command line using Newman
Walk users through installing Newman
Show how to run a collection in Newman
Share details about additional options in Newman
Building Quality APIs Using Postman
Understand what to do when tests fail.
Show example of a failing test
Walk through the steps to figure out the issue
Explain how the example generalizes to all test failures
Learn why API documentation matters and how it can help with quality. Also learn how to easily create it in Postman.
Show how to create an example
Use the example as a basis for building documentation
Demonstrate using it in the web interface
Gain knowledge in using monitors to schedule runs in Postman
Walk through creating monitor
Demonstrate various monitor options
Show how to run and manage monitors
Understand what the Postman API is and how it can be effectively used
Discuss what the Postman API is and what it does
Discuss why we might use the Postman API
Demonstrate using the API
Advanced Techniques in Postman
Drive many variations of similar tests with data.
Explain what data-driven testing is
Walk through an example that uses data-driven testing
Show running example and discuss the results
Use the Postman proxy to directly add API requests captured from network traffic.
Show how to setup a proxy on the computer
Show how to use that proxy in Postman
Walk through an example of using it
Understand how to use predefined schema layouts to quickly import full API definitions into Postman.
Explain what swagger/open API definitions are
Demonstrate how schema’s fit into this
Walk through importing an API directly through an openAPI definition
Understand how to use schema definitions as a form of contract testing.
Discuss contract testing and how it fits in with schemas
Show how to setup a test using tv4 schema validation
Change the definition to demonstrate how it works as a contract
This is a conclusion video.
Review the concepts learned
Motivate viewers to use the concepts learned to use regularly