Advanced Testing with Postman - Bearer Token Authentication via scripting

preview_player
Показать описание
In this video, we will discuss how we could get the bearer token out from one request and set it into an environment variable and use it as a Bearer token auth for subsequent requests.

Chapters:
0:00 - Introduction
1:00 - Cloning Github Repo and start using Application Under Test (AUT)
2:10 - Understanding the AUT
4:42 - Using Postman to perform API Calls (manually)
7:05 - Creating Environments configuration
9:23 - Grabbing Bearer TOKEN via Postman Scripts
11:35 - Passing the TOKEN as a header in other Endpoints

#postman #apitesting #executeautomation #testing
For more articles and videos, please follow
► [Twitter] @executeauto
► [Subscribe] @Execute Automation

New Series 2021
#############

Selenium and C#
******************

Selenium &Java
******************

CI/CD with Microsoft Technologies
*************************************

Docker & Kubernetes
************************

Mobile Testing
****************

Рекомендации по теме
Комментарии
Автор

Exactly what I was looking for. Very well explained. Thanks!

Joe-SoftwareEngineer
Автор

Thank you so much for this beautiful explanation :)

shahbazanwar
Автор

You are amazing dude. Thanks a lot. Worked exactly like I wanted

shikhars
Автор

Perfectly served what I was looking for, thanks

vigneashselvaraj
Автор

10:31 to add variable in the postman pm.environment.set("TOKEN", pm.response.toJSON().token);

abhishekkumar-abkr
Автор

Thank you so much, helped me with this snippet, I had this problem like a week, I wrote more than 20 snippets but idk what was wrong with all of them

excommunicadoking
Автор

what about on how to refresh the token automatically? when the token get expired. pls help

arjyjadraque
Автор

Exactly what i was looking for. Thanks!

izatemir
Автор

It was a very nice explanation i have been doing all these days the manual way of copying the bearer token
I need one help my auth token url uses proxy which i have already set it in the settings
Should i add something extra to consider proxy ??

aishwaryakg
Автор

Thanks for your knowledge sharing, it's works fine what you shared in video.

prakashtesting
Автор

Wonderful video. Forgive my ignorance but I need to ask. Is this the way to automatically retrieve token even when it’s change. You know bearer token expires. Thanks again.

deanskitchen
Автор

Hi Karthik. Thanks for such a great series. I'm facing few challenges while trying to open the application on localhost, saying "The localhost page can't be found". What could have gone wrong here? Can you please share an easy way to communicate with you. Thanks

prathima
Автор

Hi Karthik, I am not sure if are going to see this comment or not. But I have big issue. I called authentic API first, Then got bearer token. Used that bearer token for another API call. Now, I removed bearer token from API call and API call is still working. Why is ot so?

praveenify
Автор

Hi, can you help, please, I have another issue, I have more than 100+ requests and tests when I run collection some of my tests fails coz of the 401 status code, but when I manually log in with authorization all of them work as expected and I got what I want but what I need to do to escape this king of 401 not authorization error while running the collection for example in NEWMAN

excommunicadoking
Автор

I am not able to setup the .net application you have provided

mittaltripti
Автор

Yeah Thank you. Ur video so much helpful for me

KH-DONGHUA
Автор

Don’t forget about import swagger docs right into postman (more faster)
Of course if swagger docs build correctly

mikhailtikhonov
Автор

it is not working thanks for sharing good idea

Vikaskumar-urdi
Автор

its working
let responseData = pm.response.json();
pm.environment.set("TOKEN", responseData.jwt);

Vikaskumar-urdi
Автор

Perfectly served what I was looking for, thanks

giacomo
welcome to shbcf.ru