API Testing Simplified: Postman's Long Polling

preview_player
Показать описание
A common issue when doing API testing is to wait for a specific result. For example, waiting for an order to be processed until you can execute the following steps in the workflow.

So how to loop or retry a request in Postman until the desired response is obtained? In this tutorial, I will demonstrate two ways on how you can do that.

The code used in this video:

// POSTMAN COMPLETE GUIDE ONLINE COURSE

👉 Want to learn more about Postman? Check my Postman online course.

Get it at a special price and help support this YouTube channel:

___

// I HAVE A QUESTION!

I do my best to answer all comments here on YouTube but I cannot make any guarantees.

If you have a question, it is best to ask your question on the Postman User Group on Facebook or on the Postman Community (links below).

If you have purchased the Postman Online Course, please use the Q&A section or send me a message on Udemy.

Please do not email me or contact me on other channels as I might not be able to answer. Sorry!

___

// I HAVE A VIDEO IDEA

Do you want me to create a video on a specific topic? Just fill out the form below:

___

// P L A Y L I S T S

___

// F R E E R E S O U R C E S

▸▸▸ DOWNLOAD the FREE Postman Quick Reference Guide

▸▸▸ JOIN the Postman User Group on Facebook

▸▸▸ The OFFICIAL Postman community forum

▸▸▸ 👉 Subscribe to the "Testing and automation with Valentine" newsletter for bi-weekly tutorials, tips, and news from the industry.

___

// YOUR SUPPORT ON PATREON MATTERS

If you enjoy this content, help me create more like this. Consider supporting me on Patreon.

___

// IMPRINT

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

👉 Want to learn more about Postman? Check my Postman online course.

vdespa
Автор

This is fantastic. I was just finishing your Postman video that was posted on the freeCodeCamp.org YouTube channel, and this was last component that I needed to get some automation in place. I have 11 dependent requests that pull information from the previous requests, and about half of them take a minute or three to process. This allows me to automate the flow so I only need to start it and let it retry automatically when processes are still running. Thank you so much for all of your great content and tutorials!

andrewadams
Автор

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

shilpapaladugu
Автор

I have a problem with this solution:
What I need to do is precisely content of this material.
1. I put something on the server
2. I check if it is there
3. If it is, I take resource X
4. Uses the resource X for the next step
If I skip step 2, I usually get an error in step 3 about trying to get data from responses that are not there.
HOWEVER, if I do it manually (every few seconds I press "send" in Postman with the appropriate request), then after 2-3 attempts the data goes to the server.
If I do it in a loop (my wait is set to 3 seconds) this data never ends up on the server. I checked the answers I get and they aren't really there, so it's not the implementation's fault.
Any idea why when am I manually refreshing then data appears, and when using a loop, not?

GravityCat
Автор

We have angular in frontend and scala +postgres+mysql in backend. We didnt opt for rest assured as it will be scala. We opted for postman with individual api smoke test and e2e collection api tests . In test we have multipart form parameter I.e upload yml file. I suggested we will create nodejs project with collection env global and data folder in which yml file. N trigger through newman file. Run the newman or node command in test rail.
- folder structure
test > data > yml file
test > collection, global, env, runner.js

Question - file path I mention in collection is '/D:/test/data/tc001.yml'
How to put relative path of yml in collection.json ?

rashmiambedkar