- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Executing Tests on Cookies in Postman
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 value 1 but the actual value is cookie_Val.
- Related Articles
- How to Manage Cookies in Postman?
- How to Add Cookies in Postman?
- How to set Tests using Functional Method in Postman?
- How to set Multiple Tests for a Request in Postman with JavaScript Method?
- Run Postman Collection on Jenkins
- Executing SQL Statements from a Text File on MySQL Client
- Executing an inner join over RFC on database tables in SAP system
- Delete Cookies On All Domains using Selenium Webdriver.
- Executing C# code in Linux
- Testing of Transformer | Type Tests, Routine Tests and Special Tests of Transformer
- How to run Selenium tests on Chrome Browser using?
- How to run Selenium tests on Internet Explorer browser?
- Where are the app cookies stored on the iPhone?
- How to Generate Newman Reports on Jenkins using Postman?
- GUID in Postman

Advertisements