POSTMAN BEGINNER TUTORIAL 6 💡VARIABLES | How to create and refer
ฝัง
- เผยแพร่เมื่อ 27 ก.พ. 2018
- more about Raghav - automationstepbystep.com/
Today we will learn:
1. What are variables in POSTMAN
2. Why use variables
2. How to create variables
3. How to refer variables
Useful TIPS
WHAT
variables - elements(data store) that can take different values
WHY
to reuse values at multiple places
avoid repetition
to avoid re-work when value changes
________________________________________________________________
POSTMAN Beginner Tutorials - • POSTMAN BEGINNER TUTOR...
Playlists - / @raghavpal
________________________________________________________________
Do like, share and subscribe
Keep Learning,
Raghav
_______ ONLINE COURSES TO LEARN _______
automationstepbystep.com/
----------- UI TESTING -----------
Selenium Beginners - bit.ly/2MGRS8K
Selenium Java Framework from Scratch - bit.ly/2N9xvR6
Selenium Python - bit.ly/2oyMp5x
Selenium Tips - bit.ly/2owxc50
Selenium Builder - bit.ly/2MKNtlq
Katalon Studio - bit.ly/2wARFdi
Robot Framework - bit.ly/2Px6Ue9
----------- API TESTING -----------
Web Services (API) - bit.ly/2MGafL7
SoapUI - bit.ly/2MGahmd
Postman - bit.ly/2wz8LrW
General - bit.ly/2PYdwmV
----------- MOBILE TESTING -----------
Mobile Playlist - bit.ly/2PxpeUv
----------- CI | CD | DEVOPS -----------
Jenkins Beginner - bit.ly/2MIn8EC
Jenkins Tips & Trick - bit.ly/2LRt6xC
Docker - bit.ly/2MInnzx
----------- VERSION CONTROL SYSTEM -----------
Git & GitHub - bit.ly/2Q1pagY
----------- PERFORMANCE TESTING -----------
JMeter Beginner - bit.ly/2oBbtIU
JMeter Intermediate - bit.ly/2oziNVB
JMeter Advanced - bit.ly/2Q22Y6a
JMeter Tips & Tricks - bit.ly/2NOfWD2
Performance Testing - bit.ly/2wEXbLS
----------- JAVA -----------
Java Beginners - bit.ly/2PVUcXs
Java Tips & Tricks - bit.ly/2CdcDnJ
----------- MAVEN -----------
Maven - bit.ly/2NJdDRS
----------- OTHERS -----------
Redis- bit.ly/2N9jyCG
Misc - bit.ly/2Q2q5xQ
Tools & Tips - bit.ly/2oBfwoR
QnA Friday- bit.ly/2NgwGpw
Sunday Special - bit.ly/2wB23BO
Ask Raghav - bit.ly/2CoJGWf
Interviews - bit.ly/2NIPPxk
All Playlists - bit.ly/2LSiezA
Keep Learning,
Raghav
Website - automationstepbystep.com/
LifeCharger - lifecharger.org/
Udemy Courses - www.udemy.com/user/raghav-pal-3/
Facebook - / automationstepbystep
Twitter - / automationsbs
TH-cam - / automationstepbystep
thank you Raghav ! for this great video on postman . you are just explaining each topic peeling layer by layer going through details for newbies.
So nice of you
I love your English)))).... every seconds of this video i remember time when i was in India)))... hello from ukraine... and thx for manual... U very help me!!! thx
You're welcome Denys and thanks for your wonderful message. Best wishes, Raghav
Thanks for sharing this tutorial. It's really helpful. The best thing that I found in your videos is that they are short and precise. The short duration does not makes a person feel bored and this eventually increases the interest to watch other videos. Kudos.!! Good job. :)
So happy to see your message Ankit. Can check others here - automationstepbystep.com/
the videos are to the point and focused and most importantly have context!
i am not sure who are these people who disliked this video. In each video u r explaining things in better way. thank you for such tutorials.
Thanks for the support Akash
the videos are to the point and focused and most importantly have context!
Glad to hear this Jane
Quick and Easy to grasp! Thanks a lot for your tutorials.
You're welcome :)
Hi Raghav, your videos are short and crisp.. it does not bore quickly and this postman tutorial of yours is too good… Thanks 👏
Most welcome Arthy
Thank you Raghav. Your videos are very simple and easy to grasp. Highly informative. Appreciate your efforts. 😊
Most welcome Jerald
Excellent Video
I'm really happy to learn this postman from you... Very understandable
Glad to help Priya
Thanks Raghav for creating such a knowledgeable tutorial 😊
You're welcome Ashish
I like your way of demonstration.Very soothing and understandable.
Happy to know that Meenakshi
very informative
Good clarity and explained neatly in a very simplistic manner. Great job
Glad it was helpful Joshita
Easy way to learn the tools... Hope we will get like these for other tools as well
Sure, you can find all here - automationstepbystep.com/
Thank you for your tutorials, very useful.
You're welcome
Simply Elegant!
Thanks for the message Md. Iman
Excellent one, again thank you very much Raghav sir
Always welcome Poorna
Thank you, bro.. Really this video makes me happy. Keep uploading, please.
Thank you, I will Ahsan
You've got great knowledge of the topics you are covering. Thank you for making these videos. This helps a lot to beginners like me.
one suggestion, may be for future videos... please do not zoom in/out during lecture. cursor is somewhere and action is somewhere. However, i still liked your videos.
Sure Nazeer, will take care of this.
It's very helpful just learn like a crash course ....short and easy understand
Thanks Amit
Your explanation awesome @Raghav.
Most welcome Naresh
Thank you for talking about how to reference variables! This was really helpful. What is the difference between current value and initial value? I think that is in the 2019 Postman edition.
As mentioned in my other comment, in new ver of Postman now we have 2 values for a variable, initial and current, you can set the same value at both places, During execution current value will be referred. If you goto Settings > General, you can find a setting for
Automatically persist variable values: Enabling this will persist the current value of variables to the initial value at the end of every request execution. This option is by default off for new users. For old users upgrading to the newest versions, this option is turned on. These settings apply only when assigning current values using scripts, for instance pre-request or test scripts. For detailed information on how this feature works in tandem with another option, refer to the section Keep Variable Values.
learning.getpostman.com/docs/postman/launching_postman/settings/
Great Manual. Thanks!!
You're welcome Jose, can find all Postman Tutorials here - automationstepbystep.com/
Excellent Raghav, as usual
Thanks a ton Subash
Thank you so much Raghav for making it so easy
My pleasure Sunita
thank you, helpful and to the point.
You're welcome!
Very simple and useful, thanks a million
You're welcome!
I like the way you teach and your tone. Thanks sir.
So nice of you Raghavendran
This is the best Postman tutorial I found. Raghav, would you be able to do a tutorial video that features real-world data, and not dummy data from a site such as Reqres, please?
I will do Polina
@@RaghavPal Thank you, that will be awesome!
Thank you Raghav!
You're welcome Sergiy
Thanks a lot! Very usefull!!!
You're welcome Sandro
Thanks for such easy tutorials:)
Most welcome
RAGHAV IS JUST THE BEST!
Thanks Das, humbled..
Very excllent, keep it up
Thanks Paras
easy to understand! thanks for your effort :)
Most welcome Geeta
Thanks for such detail tutorial....
Glad it was helpful!
Thanks, this video is useful for me. Now I Khow how to make variable for my request. Thanks
You are most welcome Priana
When he changed to dark theme I knew this guy is a man of focus, Commitment, and sheer fkin will.
Thanks for the kind words Harry
Only john wick fans will understand this
Awesome tutorial.
Thanks Elijah
Really helpful.Thankyou SIr
Most welcome Anjana
Thanks in a million.
You're welcome John.
very good tutorial
thanks for watching Tapas
Nice
Very informative 😉
Thanks for watching.
Amazing thank u
You're welcome
Thank you sir for this kind of testing I really impressed by your method,,,,,and I asked for u please give some session about ranorex
Hi Rabia, I will plan
love it ...
Thanks Louie
Thanks a lot
You're welcome Ousama
Hi Raghav, Your videos are more informative with clear step by step approach the issue i am having is Variable side it only shown Add new variables which is a fields not solid words below
Hi Daniel, thanks for watching, what do you mean by not solid words below
What i mean is The fields where Add new Variable is you have to type in there but don't to do with that
The variables can then be referred to in tests. I have shown examples
your videos are jewels
Humbled to see your message Waqar. Thanks
thank you
welcome
Its a go-to session if someone wants to understand Variables & theirs scope in Postman.
Thanks for your message Naveen
Hii Raghav
In the updated version of Postman tool , at the the time of variable creation, there are two sub fields under value field , Initial value and current value...what are these for ?
Hi Madhur, yes, you can check this with the latest version - th-cam.com/play/PLhW3qG5bs-L9i-Zfy_I5OyPRxm2au_Ll1.html
use full
Thanks for watching Praveen
Hi Raghav, How would you run collections (assuming I have variables created in Global environments) via Jenkins, or even via cmdline?
Hi Rohit, you can also export environments and provide along with commands. if your collection uses environment variables, To provide an accompanying set of environment variables, export the template from Postman and run them with the -e flag
newman run www.getpostman.com/collections/id -e environment.json
github.com/postmanlabs/newman/issues/1336
very nice tuts
Thanks for watching Fayyaz
Very good, I wanted to give you 2 likes :)
Glad to know this helped Carlos
Hello, thank you for the video but I have a little problem,
In the final version of Postman. When I add variables, the system doesn't find my variable.
In this Postman version variables fields are "VARIABLE"
"INITIAL VALUE
"
"CURRENT VALUE"
Hi David,
In new ver of Postman now we have 2 values for a variable, initial and current, you can set the same value at both places, During execution current value will be referred. If you goto Settings > General, you can find a setting for
Automatically persist variable values: Enabling this will persist the current value of variables to the initial value at the end of every request execution. This option is by default off for new users. For old users upgrading to the newest versions, this option is turned on. These settings apply only when assigning current values using scripts, for instance pre-request or test scripts. For detailed information on how this feature works in tandem with another option, refer to the section Keep Variable Values.
learning.getpostman.com/docs/postman/launching_postman/settings/
Is there a way to set variable at folder level ? Is there any way to defined base path for folder so that all requests uses same base path. Essentially I dont want to use same variable in all the requests in a particular folder.
You can create variables at collection, environment or global level and use them in requests in a folder
Great beginner videos, but i still dont understand how you split the screen and made the two windows stay together. Did you go into the menu, or is it a feature in windows?
Its a OS (window) feature
In general, will this course cover scenarios I am encountering right now to test an API (eg postgresDB) to make sure the calls and other operations are being made ok in my JavaScript code? And how does Postman help with the overall Front End and Backend interaction when developing a full stack app? Can you post which links will help me on this to understand this part?
Hi James, you can check the complete playlist of Postman here and see the topics - automationstepbystep.com/
really awesome
Thanks for watching Ranjith
@@RaghavPal i want to know how to backup mysql database periodically using jenkins
Hi Ranjith, Jenkins is a CI tool, Does not have these features in-built. You can use any tools/commands as per your need for data backup and then you can create a jenkins job to run these at scheduled intervals as per your needs
Hello Raghav. I was asked in an interview that how to validate those data which are taken from a .csv file and I'm so confused to find the answer please provide accordingly.
Thanks
Hi Manas, I will need more context here. Generally you can fetch data from csv and store in a variable and use it for validation, comparison purposes. Sometimes we might need to get the entire data in some array and do comparisons.
You were talking about in Postman API level testing ( manual testing).Pls let me know
Hi Pandu, yes discussing API testing in Postman here.
I can't see "variables" tab when I click on edit, infact I can't find any of the tabs I just having only update option for name and update button down..is it a version mismatch
Hi, yes some changes in new ver
Hello Raghav, could you please make a videos about testing Web Services with help of RestAssured framework (Java) for Example?
I will do Egor
@@RaghavPal It's just awesome, thx.
Gud
Thanks
Dear sir! on updated version of postman there is no simple value column, there are three columns 1 is variable 2 is initial value 3 is current value, im confused here ive tried but its not working plz tell me what to do
Hi, so you can treat it like Variable and Current value as same as shown in video. Infact you can add same value in initial and current value field
is this case sensitive or not while coding a or setting up env in the postman? thank you great content thou
Hi Pramod, yes, it is case sensitive
Automation Step by Step - Raghav Pal thank you one best tutorial as I ever watched
hello sir nice vedios i have one doute in collections if click edit iam not getting the description ,and variables how to do this one can u plz tell .
Hi Sipala, what ver are you using. Pls check there may be some minor diff in case its a diff version but should work.
Hi! During run I am getting error - "An error occurred while running this request. Open DevTools for more info". Please suggest.
Hi Sushant, you can goto console mode and see the logs. Take help from here - th-cam.com/video/ne1RsYcgkSY/w-d-xo.html
Hi Raghav, very engaging session. However I have a doubt in this section. You mentioned about setting variables at the collection level. Also you mentioned about setting the variables at global level. When you showed that the {{{url}}} was being replaced by the actual value, was it the collection level variable which replaced this value? which precedence is higher - collection level than global?
Hi Prachi, priority is as follows:
- local
- data
- environment
- collection
- global
@@RaghavPal Thank you for your reply :) It's clear now.
RAGVAV this is nice,Do you have anything around videos associated to AUTH Authentication ,Auth0 authentication
Not yet. Will plan soon
hi how to skip request while collection running in postman
Hi Rajesh, you can use postman.setNextRequest
community.getpostman.com/t/ignoring-tests-and-requests/671
learning.getpostman.com/docs/postman/collection_runs/building_workflows/
@Raghav How to refer to variables in json body of the request?
Hi Rahul, the syntax remains same wherever you want to refer the variables. You can get some help from this - th-cam.com/video/HHASdmCR1bE/w-d-xo.html
bro i am facing issue ..when i open edit window then in the last option of variable.when i clicked not show me a key and value..just show (add a new var)..why ?? can u guide me
Hi Sumaim, might be in new version it's like that, but that's okay. When you click on add a new var it should show you boxes to add key and value. This should be fine.
@@RaghavPal I see a params list, but also when I try to insert the key and value there it does not work.
Is this video made with older version of postman?
I am not sure because I cannot find the variable option in my chrome plugin version and also I do not get to see the view and edit options at the top
Hi Sambit, you can check the new Postman Crash Course here - automationstepbystep.com/
@@RaghavPal Thank you so much
Hi @Raghav , could you explain further the differences between global variable and environments? I tried to google it but still can't really get the differences...
Hi, The diff is as follows:
1. Scope- Environment variables can be accessed with the corresponding environments. Global variables can be accessed broadly regardless of the selected environment.
2. Priority : priority is as follows:
- local
- data
- environment
- collection
- global
So in case a global variables shares same name with an environment variables, at runtime value will be referenced from env variable
3. Getting & Setting variables through scripts
- Global - pm.globals.set()
- pm.globals.get()
- Env - pm.environment.set()
- pm.environment.get()
learning.getpostman.com/docs/postman/environments_and_globals/intro_to_environments_and_globals/
pm.variables is for local variables for e.g.
pm.variables.set("variable_key", "variable_value");
Local variables are temporary values you set in your request scripts.
Also
//access a variable at any scope including local
pm.variables.get("variable_key");
//access a global variable
@@RaghavPal Thanks Raghav, your explanation made everything clear now!
hello sir when i am going to variable section it is by default showing 3 columns ( variable, initial value, and current value) so I am unable to set the variable as per according to things shown in the video
Hi Sani, this is in new version, the value you put in current value will be personal to you and what you put in initial value will be public when you share your collection in teams.
For your personal projects you can leave initial value blank or can put the same value at both places
During execution, current value will be referred.
If you goto Settings > General, you can find a setting for Automatically persist variable values: Enabling this will persist the current value of variables to the initial value at the end of every request execution.
This option is by default off for new users. For old users upgrading to the newest versions, this option is turned on. These settings apply only when assigning current values using scripts, for instance pre-request or test scripts.
For detailed information on how this feature works in tandem with another option, refer to the section Keep Variable Values. learning.getpostman.com/docs/postman/launching_postman/settings/
In edit collections page, In variable page i'm not finding key and value options.
On clicking variable directly it was showing add new variable option
can anyone please help to setup that option
Hi Ganesh, you can see the same in the latest Postman Crash Course, can find here - automationstepbystep.com/
Also please share how we can authorization to collections and how to run all the request with the same token?
Will add Harshita
Hi raghav, after adding collection level variable getting 404, earlier it was working.. could you please help?
Hi Bhushan, most probably the value of your global variable is not getting referred correctly, You will need to check the console to see the value its getting, Take help from this video - th-cam.com/video/ne1RsYcgkSY/w-d-xo.html
HI. When using variable {{url}} instead of the address, I receive a 404 error and response type in html. But when I change back to the full address, everything is fine. I receive 200 message and response is in JSON. Why is that?
Hi Bina, pls check if you are referring the variable from env, the env should be selected from the dropdown, (top right corner). Also you can check if the value is being referred in the final request using console output. Watch - th-cam.com/video/ne1RsYcgkSY/w-d-xo.html
Never stop learning
Always
The section on Global Variables was confusing and I do not understand the context of how this relates to the other part you did on variables in this session. What benefit does it provide to us to set up your "name" and "environment"? Technically, if you wanted that url variable you set at a lower level related to Requests such as GetUser and GetUserList to be used all the time for any requests made in any collection, would you then want to set this at Global Variables instead? was that the point?
Hi James, yes, in general if there is a value that you may want to use at multiple places we can put that in a variable and refer from there. Also in the coming sessions, will learn about Env variables.
Hi Raghav,
I am not getting save option while creating variable and while creating environment.
Hi Deepshikha, if you close and then check again, if your variables are there then its fine, you should just save your request after doing referencing
If i duplicate the request "GET User" from the folder "GET" from the "Collection1", the copy works !!??
should work
Hi Raghav,
I have doubt in variable and have shared the screenshot in "ImgBB" . I am not able to proceed with variables further. Hope you will clarify my doubt as soon as possible.
tia..
Hi Deepshikha, pls share the image url
@@RaghavPal i tried its working fine..thanks
Hi,
How to get key and values columns in variable section? I am getting variable , initial value and current value columns.please advice
Hi Nainsi, I did not complete get it. Pls explain with example. In case you can refer to the part in the video if related , that will help.
Hi Raghav,
For example : IN VEDIO,when you are doing right click on collection folder and navigate to variable tab ,you are able to see keys and Variable column but in my laptop I am seeing initial variable current variable columns.
Can you please suggest what settings I can change to get keys and variable columns in variable tab?
If still not understand my question please let me know.
Thanks,
Okay got it, so Nainsi, this is just a diff format in the new ver of Postman. If you put anything in the initial value, this will show when you share your collection with your team and current value is what will be used in your test when you run. Hope this is clear now.
Hi Raghav,
When I am pasting duplicate urls in initial variable how you are pasting in variable after click on update current variable by default take the same url of initial variable so I may not able to use your curly braces concept .. getting error..
hi raghav for creating a variable i have got different setup.can i send the screenshot of it through mail? can you help me to set up the key and value
Hi, that is fine, some changes in new ver, You can watch it here - th-cam.com/video/5aMqyXZRvxg/w-d-xo.html
Hi Raghav Sir, when i am editing the collection not getting variables option in chrome Extension.I can only see Edit, Update and Cancel options. Also Running window exe file from postman site is giving error on my machine. Please help
Hi Harkirat, I believe chrome extension is no longer maintained. You can check in the application.
Thanks for reply sir..I tried downloading windows exe file but when I am running it gives me error..I am not sure what to do next..
Do you get any details of the error
I think its compatibility issue. I am getting "Installation has failed: There was an error while installing the application. check the set up log for more information and contact author." My machine is old and not compatible with the exe file I believe. Tried on new machine I can see the variable under the edit. However When I am following the exactly same steps I am getting 404 instead of 200 response. The only difference i can see is under variable I have "Initial Value" and "Current Value" columns. Any ideas why I am getting 404? Thanks!
I had to upgrade my desktop app to v6.3 to see the Variable tab. Not being supported in Chrome is going to be a pain at work, where we don't have the client available. Variables is a great enhancement.
Hello Raghav can you let us know how to set variables in Version 6.2,,6.1 Postman doesnt load
Hi Akula, I saw your other comment. not sure why you are not able to use variables. Can you check with other versions
Automation Step by Step - Raghav Pal other version are not responding ,If possible can you upgrade d version there is no key an value when u edit collection.
github.com/postmanlabs/postman-app-support/issues/4594
Here it says - UPDATE: v.6.1.3 has been released which addresses this issue
Pls check
hello sir,
when i am editing the collection not getting variables option.Please help
same problem
Hope you are following exact same steps. Also check your ver.
Same issue Raghav ,Which Version is recomended ?
First of all thanks for your tutorial. There are very clear. However I don't understand what is the usefulness of global variables. I have the impression that you create variables with random names and random values. But can you explain me how is it possible to attribute them real values?
Personnaly, I'm looking for to use them to store values which come from a website thanks to webhooks. I want that each time I create/delete/update an object on this website, this one send the json file to Postman and display this file on a summary/notification screen. After researching, I believed to understand that it's possible thanks to global variables but even with the documentation, I don't know how to use them.
I'm french and I don't speak really well english for know. So may be I missed an important subtlet.
Thanks for your attention ! :)
Hi William, I will check on this and if possible will create a video lecture
@@RaghavPal Ok thanks a lot. I hope it's possible :) I would look forward to this video. I suscibe to your channel then !
404 not found error appears once replaced with url variable, how to solve?
Hi Kasun, in case it does not work, you can use any other example for practice.
How can we use variables in Test for assertion ?
Your next video is my questions answer ..
Thanks Raghav..
Great
same issue not getting variables option, using chrome extension
thanks getting variable option for windows -postman
glad to know this
From where i can get postman window based application
You can download it from - www.getpostman.com/apps
Here is the video for that - th-cam.com/video/juldrxDrSH0/w-d-xo.html
Playlist - th-cam.com/play/PLhW3qG5bs-L-oT0GenwPLcJAPD_SiFK3C.html
thx a lot
Hi still I did not able to install postman in PC .getting some error
What is the error. have you followed all steps. What is your OS ver
Need Swagger documentation tutorial plz
I will plan for this