Postman Environment Variables: API Testing using Postman - (Part 4)

  Рет қаралды 84,107

The Testing Academy

The Testing Academy

5 жыл бұрын

What is an Enviroment in Postman
An environment is a set of key-value pairs. The key represents the name of the variable. You can use a data editor to modify an environment.
While working with APIs, you often need different setups for your local machine, the development server, or the production API. Environments let you customize requests using variables so you can easily switch between different setups without changing your requests.
You don't need to remember all those values once they are in Postman. You can download environments, save them as JSON files, and upload them later.
You can create, share, duplicate, export, and delete an environment. You can also import an environment as a single JSON file.
Creating a new environment
You can create a new environment from the:
Manage Environments icon
New button
Launch screen
What is Variable?
Variables are symbolic names that represent the information you store in them. The information the variables represent can change, but the operations on the variable remain the same. Variables in Postman work the same way.
You can assign five types of variable scopes:
Global
Collection
Environment
Data
Local
Data variables
The Collection Runner lets you import a CSV or a JSON file, and then use the values from the data file inside HTTP requests and scripts. We call these 'data variables'.
To use them inside Postman, follow the same syntax as environment or global variables.
Data variables in requests
Variables inside the Postman UI are enclosed inside curly braces.
For example, in the screenshot below, {{username}} and {{password}} inside URL parameters would be replaced by corresponding values from the data file:
Dynamic variables
Postman has a few dynamic variables that you can use in your requests.
Dynamic variables cannot be used in the Sandbox. You can only use them in the {{..}} format in the request URL / headers / body.
{{$guid}} : Adds a v4 style guid
{{$timestamp}}: Adds the current timestamp
{{$randomInt}}: Adds a random integer between 0 and 1000
For a complete list of dynamic variables, refer to the section Dynamic Variables List.
Join Facebook Group : Software Testing & Automation Discussion - bit.ly/askpramod
Blog : scrolltest.com
Follow at Quora : www.quora.com/profile/Promode-1
🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌
✅Selenium Training and Certification -
scrolltest.com/go/edureka
✅Learn Jenkins for QA -
bit.ly/learnjenkins-p1
✅Programming Java -
bit.ly/learnjava2020-p1
✅Test Automation -
bit.ly/learnautomation2020
✅API Testing -
www.learnapitesting.com
✅Cypress Tutorial with LIVE Projects -
cypresstutorial.com

Пікірлер: 52
@diliphatagale7496
@diliphatagale7496 3 жыл бұрын
good bro its very helpful 1000+like
@TheTestingAcademy
@TheTestingAcademy 3 жыл бұрын
Thanks for the awesome feedback ❤️
@gundeepsingh7053
@gundeepsingh7053 4 жыл бұрын
Thanks for the collection tutorials, it was good to have deep knowledge of several pieces of it
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Thanks a Gundeep,
@meghatiwari5225
@meghatiwari5225 3 жыл бұрын
Thankyou for your efforts.
@tonyjoannable
@tonyjoannable 3 жыл бұрын
Great resource thanks for sharing
@RicardoDiaz21129
@RicardoDiaz21129 4 жыл бұрын
Very helpful, easy to understand. Thank you
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Thanks for the awesome feedback ❤️
@mangeshpardeshi9510
@mangeshpardeshi9510 3 жыл бұрын
What if we try to define 2 global variables from Pre-Request script at the same time , will it give us the result
@user-uj1we7yv6v
@user-uj1we7yv6v 4 жыл бұрын
Thanks for providing the videos. Your explanation is awesome but only thing is unable to see the text clearly.
@Zack-ni3vz
@Zack-ni3vz 2 жыл бұрын
how do you find out which API to check ? if it doesnt say API in the network setting of the chrome developers tools?
@swatisaxena1880
@swatisaxena1880 4 жыл бұрын
Crisp and clean explanation
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Thanks for the awesome feedback
@onlinebharat111
@onlinebharat111 2 жыл бұрын
@@TheTestingAcademy dude kindly improve quality of video.videos are informative but not visible
@sireeshabade2694
@sireeshabade2694 4 жыл бұрын
tq sir I learn more information
@solmazgharagozloo5848
@solmazgharagozloo5848 4 жыл бұрын
Thanks, The only problem is the quality of videos, I cannot read.
@onlinebharat111
@onlinebharat111 2 жыл бұрын
Very true,I tried watch the hd video but still it is still very light in colour.
@abdirashiidjama7739
@abdirashiidjama7739 4 жыл бұрын
Thank you!
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Thanks for lovely comment, Please share with your friends or any one who you think may need it.
@user-fw9pg9lu2i
@user-fw9pg9lu2i 10 ай бұрын
If I have two different collections and two different environments, I want to connect the 1st collection with the 1st environment and the 2nd collection with the 2nd environment for all time. Is this possible?
@vrajeshbadgujar
@vrajeshbadgujar Жыл бұрын
helpful
@Komalk29
@Komalk29 Жыл бұрын
When I am adding the value in current value and clicking on send the value vanishes and I am not able to get the response. Is there any way to save the values in particular environment?
@finder1013
@finder1013 Жыл бұрын
mean sir scoop of environment variable is greatter than global variable thats whywe can use in different work space is this is correct?
@PinoyGuitarTutorials
@PinoyGuitarTutorials 3 жыл бұрын
what happened to local variable var data = 2??
@maheshjare3824
@maheshjare3824 4 жыл бұрын
Very well explained Sir but video quality is not good .
@rajendraacharya3525
@rajendraacharya3525 Жыл бұрын
what is pre-request script ? what is global variable ? and why we use that i didn't get you properly.
@hansrajmaurya2066
@hansrajmaurya2066 3 жыл бұрын
I have confusion at 1:29 [ collection come under enviroment] or [enviroment come under collection] .
@harinivenkateshan4613
@harinivenkateshan4613 4 жыл бұрын
Hi Pramod, Very useful video. But the video quality is not good. Cannot see properly.
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Sure will take care next time
@pavithra2623
@pavithra2623 4 жыл бұрын
How to use token without expiring where should we declare it , i have declared in environment variables still it gets expired so can you help me on this ?
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Globally
@hemanthgowda5930
@hemanthgowda5930 4 жыл бұрын
Hi promod, Which is the language used in the test screen??? and do we need to learn any programming language for automation using postman? can you give your comments on these points?
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
To learn postman, you don't need to learn any language, but basics of Javascript helps in creating testcaaes
@hemanthgowda5930
@hemanthgowda5930 4 жыл бұрын
@@TheTestingAcademy ok for automation testing...same JavaScript language is required??
@poonambhondve09
@poonambhondve09 3 жыл бұрын
Very well explained. but there is 1 suggestion. you have used very small font size so it is difficult to understand.
@TheTestingAcademy
@TheTestingAcademy 3 жыл бұрын
Will take care next time Poonam
@user-fw9pg9lu2i
@user-fw9pg9lu2i 9 ай бұрын
How to delete an added environment in Postman
@TheTestingAcademy
@TheTestingAcademy 9 ай бұрын
There is option to delete ir
@parthakonda
@parthakonda 4 жыл бұрын
local vars leverage? seems like you skipped.
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Added to next video : )
@parthakonda
@parthakonda 4 жыл бұрын
@@TheTestingAcademy Great. Thanks.
@rw9422
@rw9422 2 жыл бұрын
Dude you are going to give people seizures with that intro
@TheTestingAcademy
@TheTestingAcademy 2 жыл бұрын
This is removed in new vidoes 😂
@mjhidalgocr
@mjhidalgocr 4 жыл бұрын
I almost had a seizure with that intro
@TheTestingAcademy
@TheTestingAcademy 4 жыл бұрын
Haha, thanks
Jumping off balcony pulls her tooth! 🫣🦷
01:00
Justin Flom
Рет қаралды 28 МЛН
Получилось у Миланы?😂
00:13
ХАБИБ
Рет қаралды 5 МЛН
Как бесплатно замутить iphone 15 pro max
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 8 МЛН
JSON Schema Validation: How to Validate JSON Schema with Postman?
11:50
The Testing Academy
Рет қаралды 102 М.
Postman Beginner Tutorial 9 | Environments
12:15
Automation Step by Step
Рет қаралды 47 М.
#6 How to Create Postman Variables | Environment Variables | Collection Variables
8:51
Postman Tutorial #7 - HTTP Methods GET and POST in Postman
13:18
Software Testing Mentor
Рет қаралды 43 М.
LIVE API Testing Project #1 - From Start to Finish( Add to Resume)
1:03:19
The Testing Academy
Рет қаралды 159 М.
Postman Api Testing Tutorial for beginners
16:45
Codemify
Рет қаралды 24 М.
Postman Tutorial #10 -Variables in Postman | Variable Scope in Postman
12:35
Software Testing Mentor
Рет қаралды 14 М.
Amazing tools #shorts
0:35
SA VA
Рет қаралды 10 МЛН
哈哈看到的也不一定是真的!#火影忍者 #佐助 #家庭
0:20
火影忍者一家
Рет қаралды 14 МЛН
Ăn trái gì thế/kỳ kỳ tv & Family #shorts
0:13
Kỳ kỳ tv & Family
Рет қаралды 15 МЛН