Demystifying Postman Variables: HOW and WHEN to use Different Variable Scopes

  Рет қаралды 6,971

Valentin Despa

Valentin Despa

Күн бұрын

Are you confused about the different variable types in Postman, like global, collection, environment, local, data variables? Hopefully, this will make your life easier.
== IMPORTANT UPDATE! == With Postman 7.9.0 (October 2019) it is possible to use the pm.* API to create, update or delete collection variables. Download the Postman Quick Reference Guide below to learn how.
___
// P L A Y L I S T S
▸ Learn Postman | goo.gl/iEhyzt
___
// F R E E R E S O U R C E S
▸▸▸ Download the FREE Postman Quick Reference Guide
goo.gl/GjWcvg
___
// P O S T M A N O N L I N E T R A I N I N G
💥 Want to learn more about Postman? Check my Postman online course.
Get it for only $9.99 (limited supply, 75% OFF, first 200 viewers):
goo.gl/xLnNHd
___

Пікірлер: 20
@vdespa
@vdespa 4 жыл бұрын
Collection variables are now writable! Please read an updated version of the information presented here: medium.com/@vdespa/demystifying-postman-variables-how-and-when-to-use-different-variable-scopes-66ad8dc11200
@pogothemonkey7461
@pogothemonkey7461 5 жыл бұрын
as usual, awesome video, thanks for the help! :)
@rakeshyadavvanamula5411
@rakeshyadavvanamula5411 4 жыл бұрын
Nice Thanks!
@dharmiknaik1772
@dharmiknaik1772 2 жыл бұрын
Thanks for posting this video. I was looking for this exact thing!
@vdespa
@vdespa 2 жыл бұрын
Glad I could help!
@stefanodigaetano1627
@stefanodigaetano1627 3 жыл бұрын
Great video 👌
@vdespa
@vdespa 3 жыл бұрын
Thanks 👍
@abhishekkandala7109
@abhishekkandala7109 3 жыл бұрын
Hi Valentin Despa. Thanks for this video. Is there any way i can save the assertion status(Pass/Fail) in a variable. I need to pass the assertion status to another request.
@vdespa
@vdespa 3 жыл бұрын
Unfortunately no. It is hard to help this with the given information. Join the Discord community (see link in the description) and ask your question there. Consider adding more details, including screenshots. Thanks for understanding.
@truthresonator
@truthresonator 3 жыл бұрын
Sometimes these videos are even better than that of your paid course because it's more.of.an overview in a short video with the considerations of the choices in mind.
@vdespa
@vdespa 3 жыл бұрын
Thanks for your comment. The course and the KZfaq are different approaches to delivering content. The course is better if you need a clear path to learn everything that you can do with Postman.
@Dan-rn6xm
@Dan-rn6xm 5 жыл бұрын
Nice T shirt ;)
@energydrinker5771
@energydrinker5771 4 жыл бұрын
Cannot get any variables to show using double braces in Pre-request Scripts or Tests. console.log(pm.globals.get("householdId")); works, but console.log("{{householdId}}"); literally outputs " {{householdId}}" in the console.log. I'm doing a class where pretty much the whole thing is written using the {{}} syntax. Am I doing something wrong? Is there a setting I need to change? Can you no longer access variables with "{{varName}}" in scripts?
@vdespa
@vdespa 4 жыл бұрын
This never worked in scripts. You always need to use the pm.* API. The curly braces notation only works outside of the scripts. I hope this helps.
@ismaelfarfan2990
@ismaelfarfan2990 3 жыл бұрын
The scope of collection and environment should actually be switched just because environment can be shared across all collections in the workspace, just saying. Environment sounds as a good idea until you end up with 40 possible environments to choose from: {test, test-for-collection1, test-2.0, test1, test-john, my-test, private-test, do-not-touch-test...}. I wish there was a way to actually pick collection-level variables just as we can pick environment variables.
@jarosawjusiak6716
@jarosawjusiak6716 4 жыл бұрын
What about local varables?
@vdespa
@vdespa 4 жыл бұрын
Valid point. Please see medium.com/@vdespa/demystifying-postman-variables-how-and-when-to-use-different-variable-scopes-66ad8dc11200
@jarosawjusiak6716
@jarosawjusiak6716 4 жыл бұрын
@@vdespa Thx a lot! I was trying to understand the concept by reading docs but couldn't find any good example or clarification.
@vdespa
@vdespa 4 жыл бұрын
@@jarosawjusiak6716 I had the same issue. This is why I have created this content. Let me know anytime you have other questions.
Loop request based on data from response in Postman
13:13
Valentin Despa
Рет қаралды 58 М.
What are AI Agents?
12:29
IBM Technology
Рет қаралды 120 М.
Stay on your way 🛤️✨
00:34
A4
Рет қаралды 26 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 10 МЛН
Advanced workflows (request chaining) with Postman
11:29
Valentin Despa
Рет қаралды 15 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 347 М.
Cookies: The Hidden Tech That Keeps the Internet Running
17:28
Valentin Despa
Рет қаралды 4,8 М.
How to run Postman API Tests with Newman in Gitlab CI
13:23
Valentin Despa
Рет қаралды 37 М.
Data-driven testing with different data sets for each request
16:48
Valentin Despa
Рет қаралды 15 М.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
Rob Mulla
Рет қаралды 265 М.
Run Postman Collections in Jenkins with Newman
35:35
Valentin Despa
Рет қаралды 20 М.
How to reuse Postman scripts and tests among different test cases
10:31
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 244 М.