Postman Beginner Tutorial 8 | Get and Set Variables with Scripts

  Рет қаралды 61,267

Automation Step by Step

Automation Step by Step

Күн бұрын

Пікірлер: 50
@jatingirdhar1589
@jatingirdhar1589 10 ай бұрын
Hi Raghav sir, I have been reading through all your answers to the comments. You have replied all the questions so patiently, with so much politeness & humbleness. Apart from a great trainer, I would say, you are a great human being too. Hats off to all your values & talent ! 😍😗
@RaghavPal
@RaghavPal 10 ай бұрын
Thanks a lot for your kind words Jatin.. humbled
@gabrielfrank6618
@gabrielfrank6618 Жыл бұрын
Thankyou for detailed & easy understanding of ur Tutorials !!
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome Gabriel
@SMathumithaa
@SMathumithaa 25 күн бұрын
great explanation . Thanks a lot🙂
@RaghavPal
@RaghavPal 25 күн бұрын
Glad it helped! Keep exploring
@shahzaibidreesahmed4827
@shahzaibidreesahmed4827 Жыл бұрын
Great explanation 👌Sir why and when do we use variables and what is the advantage of variables you said in this video it is used for time-saving, could you please give some physical examples?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Shahzaib Variables in Postman are used to store values that can be used in requests and responses. They can be used to store: * Static values, such as the URL of a web service or the name of a user * Dynamic values, such as the current date and time or the value of a form field Variables can be used to: * Make requests more reusable. By storing values in variables, you can use the same request for different values. For example, you could create a request that uses a variable to store the URL of a web service. You could then use that request to send requests to different web services by simply changing the value of the variable * Make requests more maintainable. By storing values in variables, you can isolate the values from the request itself. This makes it easier to change the values without having to change the request. For example, if you need to change the URL of a web service, you can simply change the value of the variable in the request. You don't need to change the request itself * Save time. By using variables, you can avoid having to type the same values over and over again. For example, if you need to send a request to a web service 10 times, you could use a variable to store the URL of the web service. You would then only need to type the variable name in the request 10 times Here are some physical examples of how variables can be used in Postman: * You can use a variable to store the name of a user. You can then use this variable to populate a form field in a request * You can use a variable to store the current date and time. You can then use this variable to add a timestamp to the response of a request * You can use a variable to store the value of a form field. You can then use this variable to make a request to a web service Overall, variables can be a very useful tool in Postman. They can be used to make requests more reusable, maintainable, and time-saving
@shahzaibidreesahmed4827
@shahzaibidreesahmed4827 Жыл бұрын
@@RaghavPal Thank you!
@vidhirathi5705
@vidhirathi5705 Жыл бұрын
Could you please clarify why "Newton" was returned as the name value even after unsetting the environment variable? Referring to Tutorial 8 at 12:02
@RaghavPal
@RaghavPal Жыл бұрын
Hi Vidhi That is because the script to print name is executed before the script that unsets the variable
@vidhirathi5705
@vidhirathi5705 Жыл бұрын
@@RaghavPal what if I re-run? Should that still be the same?
@RaghavPal
@RaghavPal Жыл бұрын
if the variable is being created or set within the script, it will be created and then removed, else not
@heenashaikh3350
@heenashaikh3350 Жыл бұрын
Hi.. Can u plz provide explanation on authorization in postman and why and from where do we need tokenization as this was asked in my interview. How and from where do we copy paste the token in authorization
@RaghavPal
@RaghavPal Жыл бұрын
Hi Heena Sure. Authorization in Postman is a way to control who has access to a particular API. There are a few different ways to authorize requests in Postman, including Basic Auth, Bearer Token Auth, OAuth 2.0, and API Key Auth. **Basic Auth:** Basic Auth is the simplest form of authorization. It uses a username and password to authenticate the user. To use Basic Auth in Postman, simply enter your username and password in the Authorization tab. **Bearer Token Auth:** Bearer Token Auth is a more secure form of authorization. It uses a token to authenticate the user. Tokens are typically generated by the API provider and are used to access the API. To use Bearer Token Auth in Postman, simply enter your token in the Authorization tab. **OAuth 2.0:** OAuth 2.0 is a popular authorization protocol. It allows users to grant third-party apps access to their data without giving away their passwords. To use OAuth 2.0 in Postman, you will need to create a client ID and client secret from the API provider. Once you have your client ID and client secret, you can enter them in the Authorization tab. **API Key Auth:** API Key Auth is a way to authenticate users by using a secret key. API keys are typically generated by the API provider and are used to access the API. To use API Key Auth in Postman, simply enter your API key in the Authorization tab. Tokenization is the process of converting sensitive data into a more secure format. This can be done by using a hash function or a cipher. Tokenization is often used to protect passwords, credit card numbers, and other sensitive data. In Postman, tokenization can be used to protect your API keys and tokens. To tokenize your API key or token, simply click on the "Tokenize" button in the Authorization tab. Postman will then generate a token for you. You can then use this token to access the API without having to worry about exposing your API key or token. To copy and paste a token in Postman, simply click on the "Copy" button next to the token. You can then paste the token into the Authorization tab of another request. hope this helps
@fouried96
@fouried96 Жыл бұрын
Hi, thanks for the video! The one priority variable you didnt show was Data, how would we set and get Data variables, and in what context are Data variables used? Thanks!
@fouried96
@fouried96 Жыл бұрын
Never mind, I see you explained this in video 13 in this playlist series👍🏻
@RaghavPal
@RaghavPal Жыл бұрын
All the best
@BartOr-k7p
@BartOr-k7p 4 ай бұрын
Hi, I have done step by-step on the video, however, the massage I get on the console is "undefined". why is that?
@RaghavPal
@RaghavPal 4 ай бұрын
Need more details, where, at which step exactly are you facing this
@BartOr-k7p
@BartOr-k7p 4 ай бұрын
@@RaghavPal Sorry it was a typo, however, I found out it is only printing me the name Edison without the name "Rutherford" on the Console.
@RaghavPal
@RaghavPal 4 ай бұрын
ok
@roushansingh8895
@roushansingh8895 2 жыл бұрын
Good one content 🤟🤟🙏🙏
@RaghavPal
@RaghavPal 2 жыл бұрын
Thank you
@inshort5341
@inshort5341 Жыл бұрын
how long the variables are valid - the local ones ? Do they expire after a call ?
@RaghavPal
@RaghavPal Жыл бұрын
Hi, In Postman, local variables are valid only for the duration of a single Postman session. This means that local variables are not persistent and will not survive between different Postman sessions or different API calls within the same session. When you make an API call, any local variables that you have set will be available for use in that particular API call. Once the API call is completed, the local variables will no longer be available for use in subsequent calls.
@roshanprajapati1579
@roshanprajapati1579 4 ай бұрын
I am not getting option as test why? Only params,headers,body, scripts, settings are there
@RaghavPal
@RaghavPal 4 ай бұрын
Roshan There are some changes in the new version. The Tests tab was renamed to the Post-response tab
@vargabghosh5497
@vargabghosh5497 2 жыл бұрын
nice video sir
@RaghavPal
@RaghavPal 2 жыл бұрын
Thanks a lot Vargab
@akhilkulkarni3130
@akhilkulkarni3130 8 ай бұрын
Where should I see the Local variable is saved or not?
@RaghavPal
@RaghavPal 8 ай бұрын
Akhil Local variables in Postman are temporary variables that are accessed within the context of a specific request or script. They are scoped to a single request or collection run and are no longer available once the run is complete. Here's where you can find and manage local variables in Postman: 1. Request-Level Local Variables: - Local variables are set within a specific request or script. - To view and manage local variables for a particular request: - Open the request in Postman. - Go to the "Pre-request Script" or "Tests" tab. - Any variables defined here are local to that request. - You can use them within the request itself or in subsequent test scripts. 2. Collection-Level Local Variables: - Collection-level local variables are accessible only within the scope of the collection run. - They are independent of environments and do not change based on the selected environment. - To manage collection-level local variables: - Click on the collection folder in the left sidebar. - Go to the "Variables" tab within the collection. - Here, you can define and manage local variables that apply to all requests within that collection. Remember that local variables are temporary and are discarded once the request or collection run is complete. They are useful for passing data between pre-request scripts, requests, and tests within a specific context. If you're looking for more persistent variables, consider using environment variables or global variables instead.
@akhilkulkarni3130
@akhilkulkarni3130 8 ай бұрын
@@RaghavPal Thanks
@gudipatisai6337
@gudipatisai6337 2 жыл бұрын
one question here raghav in which cases which variables will be used can you pls explain us in detail?? @Automation Step by Step
@RaghavPal
@RaghavPal 2 жыл бұрын
I will plan a session on this
@nahlaelnayal8644
@nahlaelnayal8644 Жыл бұрын
@@RaghavPal yes please, I am waiting for this session, thanks a lot sir.
@alihamza-eb2yy
@alihamza-eb2yy 2 жыл бұрын
Why do we use Get and set Variable?Where we use it
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi, we can use variables to store values and use them later, these values can be extracted from response and be used in next requests or within the scripts
@rathishravi2314
@rathishravi2314 Жыл бұрын
Useful
@RaghavPal
@RaghavPal Жыл бұрын
Glad to hear that
@khanhhuyen8641
@khanhhuyen8641 Жыл бұрын
I can not do "console.." , it just appeared undefined
@RaghavPal
@RaghavPal Жыл бұрын
Hi Khánh The `console` object is not available in Postman. Postman is a tool for testing APIs, and it does not have the same functionality as a web browser. If you want to use the `console` object, you can use a web browser to test your API. When you send a request to your API in a web browser, the `console` object will be available in the browser's developer tools. Here are the steps on how to use the `console` object in a web browser: 1. Open the web browser and navigate to the URL of your API. 2. Open the developer tools. In Chrome, you can open the developer tools by pressing `Ctrl`+`Shift`+`I`. 3. In the developer tools, go to the "Console" tab. 4. When you send a request to your API, the response will be displayed in the console. 5. You can use the `console` object to inspect the response. Here are some examples of how to use the `console` object in a web browser: ``` console.log(response); console.dir(response); console.table(response); ``` The `log()` method will print the response to the console. The `dir()` method will print a detailed view of the response to the console. The `table()` method will print the response in a table format to the console
@cricboyz7743
@cricboyz7743 2 жыл бұрын
actually mine name is not updated in collection like ramanujan
@RaghavPal
@RaghavPal 2 жыл бұрын
will need to check again
@moodoffbhubaneswar5486
@moodoffbhubaneswar5486 2 жыл бұрын
Sir why get and set came into picture...
@RaghavPal
@RaghavPal 2 жыл бұрын
this is to read and create variables through scripts
@akshayvetal5889
@akshayvetal5889 5 ай бұрын
😍😍😍😍
@RaghavPal
@RaghavPal 5 ай бұрын
Thanks for watching
@cricboyz7743
@cricboyz7743 2 жыл бұрын
hello sir
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi
Postman Beginner Tutorial 9 | Environments
12:15
Automation Step by Step
Рет қаралды 57 М.
Postman Beginner Tutorial 7 | How to add and refer Variables
9:02
Automation Step by Step
Рет қаралды 63 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
Learn Postman for API Testing (Step-by-Step Tutorial)
1:35:56
Automation Step by Step
Рет қаралды 32 М.
Data-Driven Testing with Testim: A Practical Demo
25:19
Automation Step by Step
Рет қаралды 2,4 М.
Postman Beginner Tutorial 6 | Collections
8:44
Automation Step by Step
Рет қаралды 89 М.
Session 5: API Testing | Postman | Scripts  & Types of Variables
1:26:57
Postman Beginner's Course - API Testing
2:09:38
freeCodeCamp.org
Рет қаралды 2,5 МЛН
Postman Beginner Tutorial 14 | How to Add Authorization in Postman
11:18
Automation Step by Step
Рет қаралды 200 М.
Postman Beginner Tutorial 12 | How to Debug
6:43
Automation Step by Step
Рет қаралды 38 М.