Debomita Bhattacharjee

Debomita Bhattacharjee

590 Articles Published

Articles by Debomita Bhattacharjee

Page 11 of 59

How to Run Postman Collection on Jenkins using Newman Commands?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 03-Aug-2021 553 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

Setting test iterations using Newman (Postman)

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 03-Aug-2021 2K+ 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

Read More

Newman Optional Parameters & Configurations using Postman

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 03-Aug-2021 538 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

How to write Assertions in Postman with Chai Assertion Library?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 03-Aug-2021 438 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

How to get the response in different format in Mock Server using Postman?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 03-Aug-2021 773 Views

We can get the Response in different formats in Mock Server. A Mock Server is created to avoid sending requests on the real time or production data. The steps to create a Response in different format in Mock Server are listed below −Step 1 − Click on New from the top of the Postman application. Then click on the Mock Server link.Step 2 − Choose the option GET from the Method field. Add /user/home in the Request Path, 200 in Response Code and the text – This is Postman Tutori in Tutorialspoint in the Response Body field.Step 3 − Provide ...

Read More

How to Import Collection in Postman?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 03-Aug-2021 2K+ Views

We can import Collections in Postman. To perform the this task, follow the below steps −Step 1 − Click on the Import menu in the Postman application.Step 2 − Import pop-up shall open with the options to import from a File, Folder, Link, Raw text and Code Repository.Step 3 − We can either import by clicking on the Upload Files button or by drag and drop option. From the Code repository tab, we can import from GitHub.

Read More

How to set Test and Collection Runner in Postman?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 03-Aug-2021 1K+ Views

We can add test verifications to the Response obtained from a request with the help of scripts. These scripts are incorporated in the Tests tab. The tests only get executed provided the request is successful.A test developed under the Tests tab is written in JavaScript. Once a request is sent, a Response is obtained along with the test results in the Test Results tab. Tests which have passed are marked in green and the failed ones are marked in red.Add the below JavaScript verifications within the Tests tab −tests["Status Code should be 200"] = responseCode.code === 200 tests["Response time lesser ...

Read More

Different types of Asserts in Postman

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 03-Aug-2021 411 Views

There are different types of Asserts in Postman. We can add Assertions on different sections of the Response received. Some of the Assert types are listed below −Assert on Response Codepm.test["Status Code is 200"], function(){    pm.response.to.have.status(200) })The above assertion passes if the Response code is 200.pm.test["Status is OK"], function(){    pm.response.to.have.property('status', ' OK') })The above assertion is applied on the Response property – status with value as OK.Assert on Response timepm.test("Response time below 600 milliseconds", function () {    pm.expect(pm.response.responseTime).to.be.below(600) })The above assertion passes if the Response time is below 600ms.Assert on Response Formatpm.test("Response is of JSON type ", ...

Read More

Executing Tests on Cookies in Postman

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 03-Aug-2021 2K+ Views

We can execute Tests on Cookies in Postman. Once a request gets executed for an endpoint, a Response gets generated. Within a Response, the cookie information gets generated under the Cookies tab.We can add Tests script around cookies and apply Assertions on them for verification. Test scripts are incorporated under the Tests tab. Let us add the below script to verify the value of cookie – Cookie_Postman.pm.test("Verify Cookie value", function(){ pm.expect(pm.cookies.get('Cookie_Postman')).to.eql('value1')})Send the Request. After the Response is received, navigate to the Tests tab. It shows the Assertion in our Test script failed as the expected value of the Cookie_Postman is ...

Read More

How to handle Infinite loops in Postman Workflow?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 03-Aug-2021 2K+ Views

We can handle infinite loops in the Postman workflow. The requests in a Collection get executed in the order in which they appear. However, we can change the workflow with the help of the function - postman.setNextRequest().It is used to direct the next request to be executed. The name of the next request to be executed is passed as a parameter to this function.Syntax postman.setNextRequest("next request name")Let us take an example of a Collection having four requests -We would like Postman to change to a workflow such that the below requests are executed from top to bottom in the order listed ...

Read More
Showing 101–110 of 590 articles
« Prev 1 9 10 11 12 13 59 Next »
Advertisements