Found 74 Articles for Postman

Assertions in Postman with Chai Assertion Library

Debomita Bhattacharjee
Updated on 03-Aug-2021 14:22:17

840 Views

There are Assertions in Postman with Chai Assertion Library. Assertions are used to check whether the expected and actual results are the same. If not, an Assertion error is thrown with an error message.An Assertion returns a Boolean value. In Postman, Assertion is implemented in JavaScript. It is available in the Postman application automatically.In Postman, the Assertions are incorporated under the Tests or Pre-Request Script tab. The documentation of the Chai library is available in the link − https://www.chaijs.com/.Let us build an Assertion to verify if the text – Postman is present in an array.   pm.test["Text is present"], function(){   ... Read More

Run Postman Collection on Jenkins

Debomita Bhattacharjee
Updated on 03-Aug-2021 14:13:45

674 Views

We can run Postman Collection on Jenkins. Firstly, we have to install Newman. To trigger an execution, we shall create a Collection having a minimum one request.The below steps list down the steps to run Postman Collection on Jenkins.Step 1 − Click on the arrow beside the Collection name in the sidebar and then click on Share.Step 2 − The SHARE COLLECTION1 dialogue box shall open. Click on the Get public link tab followed by copying the link which is highlighted in the below image.Please note -This link is not universal and applied to a specific user.Step 3 − Once ... Read More

How to Generate Newman Reports on Jenkins using Postman?

Debomita Bhattacharjee
Updated on 03-Aug-2021 14:09:37

297 Views

We can generate Newman reports on Jenkins. The reports obtained from Jenkins are a pictorial and organized representation of test execution results. These reports can also be shared with all the stakeholders of the project.Jenkins reports can be generated in several formats and can be controlled by adding different flags in the build commands. Also, it is necessary to specify the path where the reports shall be saved in build commands.The steps to generate Newman reports on Jenkins are listed below −As a prerequisite, Jenkins should be configured in the system. The details available in the link − https://www.tutorialspoint.com/jenkins/index.htm. Also, ... Read More

How to Run Postman Collection on Jenkins using Newman Commands?

Debomita Bhattacharjee
Updated on 03-Aug-2021 14:04:21

420 Views

We can run Postman Collection on Jenkins using Newman commands. To achieve this, we should first have a Collection with a minimum one request and a test. Also, we should have Newman installed in our system.Step 1 − Click on the arrow to the right of the Collection name. Then click on the Share button.Step 2 − The SHARE COLLECTION1 window opens up. Go to the Get public link tab.Then copy the link which is highlighted in the below image.Please note − This link is unique to a user.Step 3 − Open Jenkins and navigate to the Jenkins Job below ... Read More

What is API Documentation in Postman?

Debomita Bhattacharjee
Updated on 03-Aug-2021 14:00:56

395 Views

We can produce documentation for the APIs used in Postman by default.This document can be shared privately or publicly. Postman creates and hosts documentations on Collections which can be synced at the real time through the browser. Also, this documentation helps to share public APIs among teams and other stakeholders.The steps to create an API Documentation in Postman are listed below −Step 1 − Click on the arrow beside the Collection name in the sidebar. To add a description for this Collection, click on the Add a description link.Step 2 − An edit box opens. Enter some description and click ... Read More

Setting test iterations using Newman (Postman)

Debomita Bhattacharjee
Updated on 03-Aug-2021 13:54:50

1K+ Views

We can set test iterations using Newman with the help of the option –n.Newman's command to list down all options is − newman run –h. Options in Newman is grouped into these categories −UtilityBasic setupRequest optionsOther Misc. OptionsThus complete command to set iterations for two times should be −newman run Collection1.json -n 2Or,newman run Collection1.json --iteration-count 2

Newman Optional Parameters & Configurations using Postman

Debomita Bhattacharjee
Updated on 03-Aug-2021 13:53:29

343 Views

There are multiple options parameters and configurations that can be used in a Collection via Newman. The command to obtain a list of options is − newman run –h. Options in Newman can be of types – Utility, Basic setup, Request options and Misc.Utility-h, --help – to display usage details.-v, --version - to display version number.Basic Setup--folder [name of folder] – To point to a particular folder in Collection for execution.-e, --environment [name of file| URL] - To point to an Environment in the form of a JSON file.-d, --iteration-data [file] – To mention a data file to utilize either ... Read More

Running the collection using Newman through JSON file in Postman

Debomita Bhattacharjee
Updated on 03-Aug-2021 13:50:56

721 Views

We can run the Collection using Newman through JSON file. To run Collection using Newman through JSON file we should follow the below steps −Step 1 − Click on three dots to the right of the Collection name. Then click on the Export button.Step 2 − Choose the radio button Collection v2.1(recommended) and click on the Export button in the EXPORT COLLECTION pop-up.Step 3 − Choose a desired location for the JSON file and click on Save.Step 4 − Open the terminal and move from the present directory to the directory in which the JSON file is saved.Step 5 − ... Read More

Running the collection using Newman through share link in Postman

Debomita Bhattacharjee
Updated on 03-Aug-2021 13:44:55

759 Views

We can run the Collection using Newman through a shared link. To run Collection using Newman through share link we should follow the below steps −Step 1 − Click on the arrow to the right of the Collection name. Then click on the Share button.Step 2 − The SHARE COLLECTION1 window opens up. Click on Get public link. Then copy the link which is highlighted in the below image.Step 3 − Open terminal and execute the command −newman run So, here the command shall be −newman run https://www.getpostman.com/collections/ea0e981dbfa12ec5d657Please note − This link is unique to a user.If we want to ... Read More

How to write Assertions in Postman with Chai Assertion Library?

Debomita Bhattacharjee
Updated on 03-Aug-2021 13:41:51

213 Views

We can write Assertions in Postman with Chai Assertion Library. Assertions are added in tests to verify if the actual and expected results are similar. In case, they are dissimilar, an Assertion error gets thrown along with the cause of the error.Boolean value of either true or false is returned by an Assertion. In Postman, Assertion is handled by Chai Assertion Library which is developed in JavaScript. It is provided in the Postman application by default.Assertions in Postman are added under the Tests tab. The documentation of the Chai library details are present in the link − https://www.chaijs.com/.Let us create ... Read More

Advertisements