What is Postman and why everyone use it ?
Summary
TLDRIn this video, the speaker, Hes, enlightens viewers on the true capabilities of Postman, far beyond its common perception as a simple API testing tool. Hes dispels the myth that Postman is merely for sending web requests and receiving responses, emphasizing its status as an industry standard among developers. The tutorial delves into Postman's advanced features, including writing code for workflow automation, using variables, and generating tests. Hes guides viewers through practical examples, such as creating collections, setting up pre-request scripts, and leveraging Postman's environment and documentation. The video is a call to action for developers to harness Postman's full potential, promising to reveal the 'monster' capabilities hidden within this free tool.
Takeaways
- 🔧 Postman is a powerful API development tool that goes beyond just sending web requests and receiving responses.
- 👨💻 It is considered the industry standard and is widely used by over 30 million developers, including both back-end and front-end developers.
- 🚀 Postman started as a simple tool but has evolved to include features that allow for automation and scripting within the tool itself.
- 💼 Postman is free for individual users, with paid plans geared towards enterprise users.
- 📚 The script mentions the importance of understanding Postman's full capabilities, which are often underestimated by many users.
- 🛠️ Postman allows users to write code to automate workflows, making it a versatile tool for developers.
- 🔗 The video script demonstrates how to use Postman for API testing, including creating and managing collections and requests.
- 🔄 Postman supports various types of requests beyond HTTP, such as GraphQL, gRPC, WebSocket, and Socket.IO.
- 📝 The script showcases how to use variables and pre-request scripts in Postman to dynamically generate data for testing.
- 🔍 Postman provides a console for monitoring the traffic of requests and responses, which is useful for debugging and understanding API behavior.
- 📈 The video emphasizes the learning potential of Postman, pointing to its Learning Center and documentation as resources for users to deepen their knowledge.
Q & A
What is Postman and why is it considered an industry standard by many developers?
-Postman is a collaboration platform for API development that allows for sending web requests and receiving responses, but it is much more than a simple tool. It offers features like automation, workflow enhancement, and the ability to write code within the platform. It's considered an industry standard because of its extensive capabilities and widespread adoption by over 30 million developers, including both back end and front end developers.
How did Postman originate and what was the motivation behind its creation?
-Postman was created out of frustration with the limitations of using web browsers and browser plugins for API development. The founders decided to launch Postman as a standalone tool to overcome these limitations, leading to its continuous development and evolution into a comprehensive API development platform.
What are some of the advanced features of Postman that go beyond just sending web requests?
-Postman's advanced features include the ability to write code for automation within the platform, the creation of collections to organize and manage API requests, the use of variables to streamline requests, and the generation of documentation. It also supports different types of requests beyond HTTP, such as GraphQL, gRPC, WebSocket, and Socket.IO.
How does Postman handle authentication and how can it be used to automate API testing?
-Postman can handle authentication by allowing users to include authentication details in their requests. It can automate API testing through the use of variables, pre-request scripts, and tests that can be written to check the validity of responses and data, making it a powerful tool for developers to ensure API reliability and functionality.
What is the significance of Postman's variable system and how does it aid in API development?
-Postman's variable system is significant because it allows for dynamic and reusable components in API requests. Developers can set variables for parts of the request that remain constant, like base URLs, or that need to change, like user IDs or passwords. This makes the API development process more efficient and less error-prone.
How can Postman be used to generate random data for testing purposes?
-Postman can generate random data through its dynamic variables feature. Users can create variables that produce random strings, numbers, or even emails, which is particularly useful for testing APIs under various scenarios without manually changing data each time.
What is the role of the Postman Console and how does it assist in debugging API requests?
-The Postman Console provides a view of all the traffic going in and out of Postman, including request headers, request bodies, and response data. It assists in debugging by allowing developers to inspect the details of each request and response, which is crucial for identifying and fixing issues in API interactions.
How does Postman facilitate collaboration among development teams?
-Postman facilitates collaboration by allowing teams to share collections, which are sets of API requests. This enables multiple developers to work on the same set of APIs, see each other's changes, and maintain consistency across the team's API development efforts.
What are some of the learning resources available for developers to enhance their Postman skills?
-Postman offers a Learning Center that includes tutorials, documentation, and examples to help developers improve their skills. It also has a community forum similar to Stack Overflow where users can ask questions and find solutions to common problems, making it a valuable resource for continuous learning and improvement.
How can Postman be integrated into a developer's workflow to improve efficiency?
-Postman can be integrated into a developer's workflow by using it for all stages of API development, from initial request drafting to final testing and documentation. By using features like collections, variables, and tests, developers can streamline their processes, automate repetitive tasks, and ensure consistent and reliable API performance.
Outlines
🔧 Introduction to Postman's True Power
The speaker, Hes, introduces the video by explaining that Postman is not merely a tool for sending web requests and receiving responses; it's an industry standard utilized by over 30 million developers worldwide. Hes aims to dispel the misconception that Postman is simple and instead reveal its full potential. The history of Postman is briefly touched upon, highlighting its evolution from a basic request tool to a sophisticated development asset. The speaker also mentions the ability to write code within Postman to automate workflows and refers to Postman's extensive documentation as a learning resource. The video promises to delve into Postman's capabilities beyond simple web requests.
🌐 Exploring Postman's Interface and Web Requests
Hes demonstrates how to use Postman's interface, starting with creating an account and navigating the dashboard. He discusses the importance of collections in organizing web requests and shows how to create a new collection and add requests to it. The video also covers setting variables within Postman to streamline requests, using the 'Set as Variable' feature to simplify repetitive tasks. Hes emphasizes Postman's ability to handle various types of requests beyond HTTP, such as GraphQL, gRPC, and WebSocket. The speaker also introduces the concept of using Postman's console to monitor traffic and inspect responses, setting the stage for more advanced topics.
🔄 Postman's Automation and Dynamic Data
The video segment shows how to automate testing with dynamic data in Postman. Hes explains the process of registering a user through Postman, using variables to generate random data like email addresses and passwords. The speaker encounters an issue with role validation and decides to resolve it by writing a pre-request script to randomly select a valid user role. Hes demonstrates how to use Postman's scripting capabilities to interact with environment variables and customize request data dynamically, showcasing Postman's flexibility in testing scenarios.
💻 Debugging and Scripting in Postman
Hes encounters a problem with the random username generation and decides to debug it by writing a pre-request script to create valid usernames. The speaker walks through the script, explaining how to loop through letters and randomly select characters to form a username. Hes also shows how to check the response in the console and adjust the script accordingly. The video segment highlights the importance of debugging and the power of Postman's scripting for automating and personalizing API testing.
🔗 Testing and Integration in Postman
In this part, Hes focuses on testing the registration API effectively by automating the process in Postman. The speaker shows how to extract data from responses for future use, such as logging in, and how to save and reuse variables for consistent testing. Hes also introduces the concept of generating tests in Postman, which automates the process of verifying responses and checking for expected fields. The video segment emphasizes the integration of testing within the development workflow and how Postman streamlines this process.
📚 Postman Learning Center and Community
Hes concludes the video by encouraging viewers to explore the Postman Learning Center for further insights into Postman's capabilities. The speaker mentions the availability of documentation, scripting guides, and community forums as resources for learning and problem-solving. Hes reflects on the video's aim to change the perception of Postman from a simple tool to a powerful development asset. The call to action for feedback and further exploration of Postman's features wraps up the tutorial.
Mindmap
Keywords
💡Postman
💡API
💡Collection
💡Variable
💡Environment
💡Scripting
💡Documentation
💡Testing
💡Automation
💡Workflow
💡Learning Center
Highlights
Postman is not just a tool for sending web requests and getting responses; it has much more functionality.
Postman is considered the industry standard by many developers for API testing and development.
Over 30 million developers use Postman, indicating its widespread adoption and utility.
Postman allows users to write code to automate workflows, enhancing its utility beyond simple API testing.
Postman is free for individual users, with paid plans aimed at enterprises.
The presenter demonstrates how to make a web request using Postman and explains the process in detail.
Variables in Postman can be set at different scopes, such as collection or environment-specific.
Postman's Console provides insights into the traffic of requests and responses, aiding in debugging.
Postman supports various types of requests beyond HTTP, including GraphQL, gRPC, WebSocket, and Socket.IO.
The use of variables and dynamic content in Postman can simulate real-world scenarios for testing.
Pre-request scripts in Postman enable the manipulation of data before a request is sent.
Postman's ability to generate random data, like emails and passwords, is showcased for dynamic testing.
The presenter discusses how to handle errors and invalid responses when testing APIs with Postman.
Postman can automate testing through the use of collection runs and the generation of test scripts.
Postman's Learning Center and documentation are highlighted as valuable resources for users.
The video concludes with a call to action for viewers to explore more of Postman's capabilities.
Transcripts
hey there everyone my name is hes and in
this video we are going to talk about
what is postmen and in case you are
thinking that I know postmen Postman is
just a simple tool through which I can
send the web request get some response
back and just check out whether my API
are working or not no my friend you are
absolutely wrong in that case of course
Postman does exactly that but it's not
just that simple that you can explain
the postman by hey it sends a request
and gets the response this is exactly
the point where a lot of people make
mistake I mean just think for a second
just think for a second and just realize
why everybody on the Internet calls that
Postman is the industry standard for
every developer whether it's a back end
or it's a front end why almost every
developer says that hey my company uses
Postman and if you just look at this on
their website in itself you'll notice
they say that over 30 million developers
use postmen so there might be something
that we are absolutely missing about the
postman than sending just the web
request and this is exactly that video
where you understand that how you can
utilize the postman I'll walk you
through with a small glimpse and hints
of where the power of the postman comes
around and of course we're going to be
going through with the postman this
video will help you to understand what
all and what more you can do with the
postmen and of course we'll answer the
question what is Postman so in the early
days Postman used to be a a very simple
client in which you can just send the
request and get the response back it
used to be done mostly with the web
browsers and some of the plugins of the
browsers which is not a good idea for
working with that so one day the
founders of the postmen got really
frustrated and they said I'm going to be
launching this tool on its own so that
we can make more than making the web
request rest is all history and the
postman was born out of that and through
which postman has seen a constant
development cycle and it is St still not
stopping on that part it is now not just
a request uh mechanism tool it does so
much more and we're going to be seeing a
glimpse of that not only that you can
write code inside the postmen to
automate so much of your workflow in
fact that's just a part of it which I'm
sharing you I'll show you the
documentation of the postman to to share
that what more you can learn directly
from the postman documentation and the
best part of course it's free you you're
already using it I'm just want I'm just
here to make sure that you understand
what power Postman brings to you and why
you are not using it and all the people
who are pro developers experienced
developers they are using it every day
so we're about to here to change this
one and let's go ahead and get started
so let's start with the basic that this
is the postman website and you see that
30 million developers are here and if
you just go ahead and look at their
pricing uh this is the best thing that
everybody can see that hey this is
Basics and all not and whatnot uh but we
all know that postmen is free uh you can
just go ahead and use that these Postman
pricings are for the Enterprise they
don't charge for Indie developers
anything at all although the pricing
page is pretty nice what all we offers
and all of that uh but yeah as a
individual user it it doesn't cost me
any money I just use it and it it
generously offers me anyways we we're
not interested in that part we are more
interested in something more so I have
already created an account and this is
how the postman account looks like by
the way uh if you want to use Postman
without this you can just go ahead and
do that I prefer to have my account
because we use it in and out in all of
our application first uh how can we use
this where can we make the web request I
do have an open source project on this
we're going to utilize this uh but you
can use any of the web request for that
so the project is free api. app and in
this we can just check the project we
will check the project while writing
some of the scripts but all I want to
show you is cooked in docs once you open
the cooked in docs uh this is how you
can make a web request so uh we'll go in
the authentication because that's where
we need to automate some of the stuff
but let's just say right now we'll see
the public apis I want to grab a random
joke book stocks what should I get
random code random code would be really
nice so uh there's random Cotes and
there is a random get one random code so
IID like to make a web request onto this
one I can go ahead and try this out and
I can execute this and I can see that
okay this is the point where the web
request was made although this is very
nicely cooked Docks but not all the
application that you're developing
doesn't have this kind of really nice
cooked in docks you want to just see how
it's going on in the local host and make
a collection of it all right so this is
what I get uh in the response about the
author and all the author Slug and the
content and all of that now the whole
idea is I want to just go ahead and copy
this whole thing and I want to make the
same request with the postman to just
get started and then we are going to
write some scripts automate that to see
the true power of the postman so what
I'll do is I'll just go on and open the
postman this is what we have this is how
it looks like uh maybe you want to log
in not log in that's up to totally your
call now next thing is I want to make a
web request the first thing that you're
going to see is I can just click on the
new and it opens up the web request the
type of web request I can make I can
make an HTTP Tada obvious but we can
also make the graphql grpc websocket
request socket IO whatever you want to
go we can go with that I don't usually
go with this kind of a style because
this is just one off a request let's go
ahead and try that then I'll walk you
through with what I use as a workflow
majorly of the time I can just start a
web request I can just go ahead and say
hey this is my web request go ahead and
make a get request on this one by the
way of course you can use or you can
type the new method as well but I'm
happy with the get I'll just go ahead
and send the web request and that's the
major use case from the majority of
people that this is it maybe I'll just
save it but let me walk you through with
the true power of how the postman
actually goes go ahead and work for it
so what I'll do is I'll just remove this
I don't want to save it majority of the
time I just go ahead and try to create a
collection for this one so I'm going to
go ahead and create a blank collection
but you have a whole lot of templates
that you can use around once you are uh
familiarized with how to utilize Postman
and its true hidden superpowers I'll
start with the basics so I'll just go
ahead and create a b blank collection
and I'm going to name this collection as
a YouTube uh demo Postman YouTube demo
is good enough all right now inside this
YouTube demo collection I can add a web
request but you can also go ahead and
see that there is so much more that you
can go ahead and work with that yes this
is what I really like that how much
superpow is there and how much you can
utilize this so I'll just go ahead and
move this here so that we can see it all
up here so this is what we have now I'll
just go ahead and click and I'll say
that I want to add a request you can add
subfolders into this if there's a need
for this so I'll just let's just add the
folder and in this folder I'm going to
go ahead and call this one as uh public
because that's what we are calling and
inside the public further I want to add
a request by the way you can add outside
as well but I'll add the request here
now in this I would love to make a
request to this one so we see that okay
it works it works really nice but
obviously in the very near future I'll
be making more web requests to this
entire API and that the routes could be
different but I have noticed already
that api. free api. apps / API slv1 this
is going to remain exactly the same so
how we can make this a little bit easier
I can just go ahead and select all of
this and yes it pops up says set as
variable I'm going to go ahead do this
uh I'll set as a new variable I'm going
to call this one as uh my uh server
looks pretty good and further I'll
select the scope so scope is something
that this variable should be available
to all of the collections that I have or
particular collection that I'm asking it
or the active environment I I'll talk
about the environment probably later on
but right now I'll just say in this
collection only this should be available
this is my scope of this variable just
set the variable and that's it now this
is set as variable makes my life a
little bit easier yes still it makes
this it send the web request but makes
my life a little bit easier things are
okay at this point and you say hey I
know this part this is pretty obvious
can you show me something really nice
let me walk you through first of all if
you look at this part here uh this is a
little hard to see but this is here you
can go ahead and see the console that
what requests are going in this is all
the traffic that is going outside of the
postman and all the traffic that's
coming in that's here in the response we
have the cookies we have uh the headers
whatnot and all these things this is
what is coming in now to explore things
in a little bit more and we'll be
writing some code as well uh let me walk
you through that part as well now if I
go back onto this docs we have done with
the public request we are pretty aware
of it we'll close this one not
interested in the public API part I'm
more interested in doing some
authentication while doing the
authentication the first step is
obviously to register a user I go ahead
and uh do this I want to try this out uh
heads up I tried this before making this
video so obviously this test user might
be already registered but we'll see that
I'll go ahead and execute this and this
gives me a response that you know what
the status code and all the thing user
is already registered let's try to
modify this so how can I modify this I
can go ahead and change things here user
email and domain so instead of this
we'll go ahead and say this one is uh
example if I can write that that would
be really
nice there we go uh user. email instead
of that uh let's go ahead and uh call
this one as t t. example uh password is
okay role is admin and we're going to be
changing the username as well to T I'm
pretty sure that's not register although
this is public API and people register
all kind of users but we reset that in
our database uh timely let's go ahead
and try to execute now if I execute this
is the response that I got that hey user
was successfully registered in your
application okay nothing nothing super
uh extreme in that case but let's go
ahead and try let me show you the power
of the postman I'll copy this route and
now let's go ahead and create another
folder where I want to check the O uh
create new folder and add a folder I'll
call this one as o and inside the Au
we'll make a new request obviously this
request is going to be of type uh post
but I don't have to copy the entire URL
because I know that I can just go ahead
and use uh my server this is a variable
and after that I can make uh whatever
the slash request is so in this case it
is just the slash userregister makes
life a little bit
easier I'll go back and I'll just say
hey this is what where I want to send
the request of course this is a post
kind of request if I send the request
just like this it will say hey email is
required email is invalid all those
validation check by the way we'll go
into the code part as well of this open
source repository uh this is really nice
I'm happy with this but this is not the
response I'm looking up forward so I
need to send some data although this
docs really help that I have to send
this kind of a data how can I send this
pretty easy uh you have all these
options to send the body if I check the
body here I have the option to send form
data we have the option of uh URL
encoded forms you have raw data and all
of that by the way with the form data
you can change the type text to file and
can send the files as well uh just the
basics or you can set the binaries send
the files directly I'll show you some
fun stuff around that as well but in
this case I'm more interested in the raw
and there's a lot of data type you can
send I'll just send the Json and this is
how you send the Json request oh this is
fun okay now this is what the example
what we have but this user is already
registered we know that part if I if I
go ahead and send this oh this is
already registered a user with this
email and username already exist ah this
is nice so we have a response which is
already being done now first interesting
part is I can just make a right click or
a click on this one and uh you can do so
much more onto this one that you can
actually save this uh as an example as
well I'll just go ahead and we'll save
it later on but right now I want to
worry something that hey this is not
going to work any given time if I have
to come up here and have to work it like
this this is definitely not going to
work I cannot come up with different
emails every single time I have to check
this one this is the first interesting
stuff comes up in the postman itself you
can just remove this email start your
variable holders placeholders two curly
braces and then you can use a dollar
sign look at the list of it yeah uh you
can just go ahead Postman knows it that
there is so much Randomness that happens
while testing that's why I say this is a
testing first company they knows the
stuff that is being randomly used notice
here pretty much anything that you want
but there are some things which are not
there how can I come up with that that's
where we are going to learn so in this
case I I'm going to go ahead and say I
want a random email this will generate a
random email for me pretty cool okay uh
let's go ahead and see that if it is
able to do this or not uh let's go ahead
and send a post request uh user user
with email or username already exists so
right now user with either email or the
username is already exist but I want to
see this let's see in the console and if
I go ahead and open up the post request
uh notice here the post request I can go
ahead and check all of this request
header I can see the request body as
well and there we go this is my email
which is absolutely random told you it's
it's super fun and you are not utilizing
its true superpow uh let's go ahead and
close this and send one more to just see
this notice here the new one comes
around and at least this part is working
I'll open the request body and I'll say
hey there is this one another Hotmail
user guess Postman loves Hotmail I don't
know okay so one part is solved how can
I grab the password as well can I go
ahead and grab the password just like
this yes you can just do that oops too
many curly braces and I can use a dollar
sign and I can there's so much more into
this one and I can go ahead and use a
random password is there a random role
available as well let's go ahead and try
this obviously Postman doesn't know what
kind of role we are supporting in our
open source project so I'm pretty sure
that doesn't exist random
roll no such thing as random roll if
you'll do this it's it's going to be a
bad request but we need to see those bad
request as well that's the testing send
this open the
console and open this part and what
we're going to do is okay and let me
just go ahead and move this here a
little bit you can see it properly and
here is my response body and in this
invalid user role what you're saying uh
request body here and there we go
password is there random R the variable
was shipping in as it is this is not
good this is not good I want to send
something more uh this is not going to
cut through so there is two challenges
in front of me first of all this random
roll it's not working and the random
username this is not working so what you
can do further in the postmen you can
come up into the
prequest script uh perfect name I don't
need to explain it more all the script
that runs before you send your request
that's it TAA so what I want to do is
let's just say I have a function and
I'll do a deliberate mistake here just
warning you in advance I'll just go
ahead and say get a random rule so I'm
defining my own function here by the way
you can use Arrow functions as well I
like to go with the classic uh I'll go
ahead and say I'll go with the roles and
what roles you have and we are going to
say we do have an admin we do have a
user and probably we do have guest so
these are my roles now I want to select
a random role based on this pretty easy
you can go ahead and find roles and we
can just use whatever the index is B
based on it's a classic JavaScript yes
JavaScript works everywhere almost
everywhere uh we'll just float it out
and then we're going to go ahead and say
math and we are going to use a random
there we go we have randomized the stuff
and we can multiply it by
roll dot length so there we go now it is
governed by the RS length and we will be
able to grab it uh now there are a
couple of uh problems and hints uh that
okay I have defined my function but how
does my body is going to know that hey I
do have these uh new variables available
for me so all you have to do is PM yes
there is a thing known as PM Postman yes
and you can just go ahead and say dot
there is ton of thing that you can do I
bet you didn't know about it so you can
go ahead and set about the cookies
environment
execution honestly I'm not even aware
about all of them I just use few of them
so one thing that I often use is pm. uh
environment yep that's the one and
there's only couple of options that you
use for the environment you either set
it clear it mostly you just set it or
get it I I rarely clear the stuff so the
get one is here uh sometimes I do check
has as well but very rarely we we can
just go ahead and use get so not the get
we want to set the environment first my
bad so what do you want to do is when
you want to set an environment you pass
on what environment variable name should
be and how should I set it uh how it's a
easy part get random role and go ahead
and execute that so that you return a
role and where should I return this role
so simple just go ahead and call this
one as random role now that a new
variable is is available I can just go
ahead and save this the only thing you
have to keep in mind is when you check
the body you cannot now just use the
dollar the dollar sign is reserved for
the postman variable itself this is not
a postman variable this is hes variable
I I designed it anyways I can just go
ahead and say the random role now it is
not going to do our job entirely but
it's it's a one step ahead I'll just
click on Save first then I'll open up
the console I can clear the console and
now let's go ahead and send the request
there we go we have send the request it
doesn't still does the job notice here
it's it's still Falls we'll come up
there I'll just open the postmen I'll
open the request body and I need to
shift this I need to open the request
body and then in the request body notice
here the role name is guest so this is
coming in now this is giving us a
problem but the username is also giving
us the problem so first we'll solve the
username problem and then we'll solve
the rest of the problem so username how
should we get the username now there are
lots of ways on the username of getting
that I'll just grab a username which is
all lowercase so I'll just go ahead and
say
function get a random username just like
that we'll just go ahead and work with
this I can just go ahead and write these
scripts now the first thing that I have
to do is grab all the letters so I'll
just go ahead and grab this now how can
we do this let username equals to just
like that we'll Loop through all the
values I wish there could be some
suggestions there but hey I'm asking too
much so I'll just go ahead and write
this like this for let i h really
boring we start with the zero and then
we go ahead how much long the username
you want I'll just say I want just the
seven letters here and I'm going to go
ahead and say i++ really basic oops so
this is my Loop and in that I'll just go
ahead and say this username needs to
plus equal uh with the letters and the
character at which character I'm going
to be choosing I'll be doing the math
random again can I copy paste this at
least this part I can copy
paste H why not copy and paste this so
we have a mt. floor we have a mt. random
and that's going to get multiplied by
the letters length this time super easy
letters. length not bad all right uh
once this is all done we'll go outside
of the loop and we'll just go ahead and
say I want to return the username hope
that is cooked so now it is pretty sure
that the username will come up uh this
whole thing is pretty nice and easy I'll
just go ahead and get some space for me
I can I duplicate this oh I can use the
keyboard shortcuts oh I didn't knew that
uh we can just go ahead and say get
random username just like that and I'll
just say this one is random username
pretty cool and now in the body this is
not going to still solve the problem
I'll show you some of the open source
hacks as well uh I can just go ahead and
copy this stuff why should I copy
this and I can just go ahead and say
random username these are my variables
uh it's still not going to solve the
problem but that's not the postman
problem this is how we debug the stuff
so I thought I'll include that part as
well I'll open this up and I'll say that
hey let's make a web request let's open
the console clear this up and I'll send
this request so let's see what's
happening in here again move it a little
bit here uh response body and there we
go username is coming in nicely and we
have the password everything is pretty
good this should actually go through
this should go through this didn't got
me the error this should go through ah
this this this goes through uh let's
let's try it one more time oh there we
go invalid user role so why we are
getting invalid user R we saw that it
works but at the way uh I have designed
this tutorial the way things should have
happened is we should have got this one
first so why is this invalid role uh
this is where the open- source uh power
comes in that I can go ahead and look in
the project itself I'll open this
project in a new tab and this is the
whole source code that we have available
here now I want to see what's happening
in the source code to see that hey what
kind of users you are actually accepting
what roles you are accepting I just
wrote it as randomly admin user guest
but I have no idea how the roles are
actually going in this is where you see
the source code of an open source
project I'll just probably Zoom it a
little bit and and the first obvious
step is go and check out is should
be uh let's go ahead and uh see where
are the models here are the models in
the O in the user model let's see how
the user model is being defined if I
check this one here oh there's a user Ro
enums where is this uh it's coming up
from the constant. JS so I'll hunt for
the constant I can just search for it as
well but I know uh we designed it so I
know that constant. JS I can just go
into it and oh this is where you are
saying so you have you're supporting
only admin and the user as a role oh
nice I can modify this app as hey I'm
not supporting the guest uh maybe some
other app is so I can reuse my script
I'll just use go ahead and save this and
that's it I fixed the bug and now if I
make a web request it is every single
time going to uh just work with that and
there we go now whenever I need to test
my register API this is an automation
work all I can do is work for this not
only this is I can save these variables
even I can show you how to save these uh
responses and extract some of the data
like for the login purpose if I go ahead
and check how do you log in uh let's go
ahead work like that how do you log in
what data you need you need password and
username only so I can extract from this
whole response uh that give me just the
username and the password yep username
and the password and I can store the
password uh from this or I can just
create instead of random password just
one password for all the tests which is
a common practice I can just go ahead
and do that now in the future I can just
click on this o and uh not the O this
entire collection I can just go ahead
and start run collection so every single
request that is there will automate
there and go ahead and check uh whether
I'm doing all okay or not now if I go
ahead and look onto this one uh you'll
see that there's so much more that is
going on with this one uh just one more
fun stuff because you are so interested
in this one I can just go ahead and look
for YouTube demo and I can say generate
tests yeah that's nice and I can
generate test for whatever the request
I'm looking up forward I'm interested in
this post new request so I'll just go
ahead I should have saved this with some
name that would really make sense so
I'll just go ahead and call this instead
of new request uh we'll call this one as
register that's that's better actually
uh now let's do oops wrong click I can
go ahead and say generate test which
which is in beta but I still love it it
does the job uh this is my register
request so I'll just go ahead and see
this okay this is really nice and I can
just go ahead and register the test uh
this is fairly a new feature uh but
we'll just go ahead and we'll just say
generate the test and now it's uh
couldn't add this due to previously
failed request fix the request oh we
have to fix this we forgot to save my
bad uh and uh okay we'll just remove
this public we are not interested in
this part delete this forgot to
save okay this one is save this one is
save let's go ahead and send this and
there we go we are doing absolutely fine
now now I can go ahead and hit the
generate test again let's just generate
this now this is generating it's working
on it you see the test there and verify
the avar object is present in the
response it it does it on its own a
little AI there but I can fix that I can
see in the body what is the status code
and I can just go ahead and save this uh
respon code you can see that hey and
notice here it's actually even writing
these whole things for me can I just go
ahead and move things here anyways so
notice here again pm. test so you can
you're writing automated test scripts
for that required field that these are
expected Fields valid format email is in
valid format you can just go ahead and
write your own as well but hey these
tests are being generated so anyways you
get the power of this one but I'm not
done yet I'm not done yet this is just
to make spark the Curiosity in you that
there is so much more in the postman so
stop calling it as just hey this is
anyways in the postman if you go ahead
and look on this there is a postman
Learning Center yes because there is so
much that happens in this one I think
it's worth spending your time into this
one if you just go ahead and get started
with send request response and all of
this but there's so much more in the
postman flow collaboration and whatnot
you can even look at the postman docs as
well which is still in the Learning
Center if I just move this here uh what
you'll notice this is in the Learning
Center in itself there is so much that
you can do and uh if I just look at the
write script part and write pre-quest
script write the test with monitors
write test this is where I saw this hey
I can do so much of scripting in the
postman and they give you nice examples
of how postmen collection variables set
details God knows what uh this is all
you can do and you can just edit them
work with that next steps write the
tests this is how you can work with that
and there is so much so much more that
you work with that even uh if you want
to get the random email there is a
community. postman where you can find so
much of answers it's like their own
stack Overflow uh but it's already
pretty default and work with that so uh
this is the basics of how I want you to
see the postman from a different
perspective so yes I know this is a 30
minute long video about what is Postman
but I think somebody needed to come out
and say that Postman is beyond just
sending the request and getting the
response and I think with the demo you
understand more so now if you're a
backend developer or a front-end
developer you truly understand what kind
of monster the postman is it is super
crazy powerful and that's why I'm a big
fan of it and it's free and that's why I
love it even more so that's it for this
video if you want me to uh design a
little bit more on the postman side like
what more we can do and how we can uh
integrate it in our workflow let me know
in the comment section I would love to
do that uh that's it for this video
let's catch up in the next
one
تصفح المزيد من مقاطع الفيديو ذات الصلة
Postman Beginner Tutorial 1 | What is Postman
Postman Beginner Tutorial 13 | Data Driven Testing | How to get data from CSV and JSON files
ASP.NET Core Web API .NET 6 2022 - 1. Create Project & Quick Tips
Fuzzing for beginners! FFuF - Hacker Tools
Vite Crash Course | Faster Alternative To CRA
Asp.Net Core Web API Client/Server Application | Visual Studio 2019
5.0 / 5 (0 votes)