0% found this document useful (0 votes)
30 views

Lesson 02 Collections

An automation testing engineer is assigned to create a Collection in Postman to organize similar API tests developed for a new application. A Collection allows users to save and organize API requests into folders to run multiple requests simultaneously. The engineer will learn how to create, run, and share a Collection, as well as remove a Collection from a workspace. Newman is a command-line tool that allows executing Postman Collections from the command line for continuous integration. [/SUMMARY]

Uploaded by

ryadav
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Lesson 02 Collections

An automation testing engineer is assigned to create a Collection in Postman to organize similar API tests developed for a new application. A Collection allows users to save and organize API requests into folders to run multiple requests simultaneously. The engineer will learn how to create, run, and share a Collection, as well as remove a Collection from a workspace. Newman is a command-line tool that allows executing Postman Collections from the command line for continuous integration. [/SUMMARY]

Uploaded by

ryadav
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Automation Testing

Collections
A Day in the Life of an Automation Testing Engineer

John is now familiar with functional testing of the company's systems.


He is now assigned to create a Collection in Postman to group the
similar API tests he had developed as part of the new application.

After completing this session, John will be able to create and run a
Collection in Postman.
Learning Objectives

By the end of this lesson, you will be able to:

Define a Collection

List the steps to create a Collection in Postman

Explain the steps to run a Collection in Postman

State Newman in Postman


What Is a Collection?
Collections

A Collection is a bunch of API requests that can be saved and


organized. It allows users to:

• Create folders
• Insert similar requests into a folder
• Run multiple requests at a single click
• Run subsequent requests
• Create easy API Documentation
Why a Collection Is Used?
Why a Collection Is Used?

In Postman, a Collection A Collection ensures that In a Collection, team


allows users to save and the client's demands are members in the Postman
organize a bunch of API better organized and workplace can easily
requests into folders. documented. access API requests as
these are saved and
organized correctly.
How to Run a Collection?
Collection Runner

Users can run a Collection to simultaneously initiate several requests in Postman.

The Collection does not provide a response body for each request after execution.

The Collection Runner console generates a status for every request, pass or fail.

A Collection Runner must have at least two requests for the Collection.

The Collection Runner also contains information on the response code, time, payload size,
and checkpoints. Results are displayed in green for passes and red for failures.
How to Share a Collection?
Sharing a Collection

Users can send links to the Collections from the Postman app to those who are not on the workspace
team. They can also send the Collections directly to the team. Users must be signed in to share a
Collection on Postman.

Shared from the sidebar

Shared from the Browse option


Here are the
Shared to a workspace
methods to share
a Collection in
Shared as an embedded options
Postman:
Shared through a public link

Shared as a file
How to Remove a Collection from
Workspace?
Removing a Collection from Workspace

The Remove from Workspace If the workspace is personal, users


option removes the Collection from can delete it by selecting the option.
users' current workspace. However, if a team shares the
workspace, they will need the
authorization to remove any
Collections or requests from the
workspace.
What Is Newman?
Newman in Postman

In Postman, Newman is a command-line Collection Runner.


It is used to:

• Execute and test a Postman Collection


• Connect a Collection with continuous integration servers
and build automated systems
• Run Remote API
• Stop API running when test cases failed
• Specify request timeout
Features of Newman in Postman

Users can execute a Postman Collection directly from the command line using Newman.

Newman is a command-line Collection Runner for Postman on the company's official


website. It makes Postman and Newman a unique combination.

Users can use Newman to run Collections in the same manner that a Postman Collection
Runner does.

Continuous integration by Newman in Postman makes this combination of tests and code
successful and enables users to merge the various codes and run the tests continually.
Advantages of Using Newman

It utilizes
the Newman
It offers test It can conduct
command-line tool
suites that are Instantaneous
to integrate with
simple to make. testing.
build systems,
It allows keeping It can quickly
such as Jenkins.
data needed to transfer
conduct tests Environments and
in various tests to code
Environments. repositories.
Key Takeaways

A Collection in Postman is a group of API requests.

The Collection Runner is used to perform API requests


of a Collection in a specific order.

Newman is a command-line Collection Runner for Postman.

Newman can run a Collection through the command line,


and the results can be exported to a JSON file.

You might also like