Postman Beginner Tutorial 13 | Data Driven Testing | How to get data from CSV and JSON files

  Рет қаралды 56,391

Automation Step by Step

Automation Step by Step

Күн бұрын

All FREE courses - automationstepbystep.com/
Data Driven Testing
How to get data from CSV file
How to get data from JSON file
How to run Data Driven API requests
How to run Data Driven tests
Useful Tips
Step 1 - Create a api request
Step 2 - Create variables and refer in request
Step 3 - Goto Run Collection
Step 4 - Create a CSV file and add data - Refer this file in Run Collection
Step 5 - Create a JSON file and add data - Refer this file in Run Collection
Step 6 - Refer data in test scripts
tests["verify email"] = responseBody.has(data.email)
tests["verify email"] = responseBody.has(data["email"])
#PostmanDataDrivenTesting
____________________________________________________________
Stories by Raghav - automationstepbystep.com/stor...
My Udemy Courses - automationstepbystep.com/udem...
Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you
You can support my mission for education by sharing this knowledge and helping as many people as you can
If my work has helped you, consider helping any animal near you, in any way you can.
_______ ONLINE COURSES TO LEARN _______
automationstepbystep.com/free...
GitHub - github.com/Raghav-Pal/
Udemy - www.udemy.com/user/raghav-pal-3/
Training by Raghav at your venue - raghav.qna@gmail.com
Training schedule - automationstepbystep.com/trai...
----------- UI TESTING -----------
Selenium Beginners - bit.ly/2MGRS8K
Selenium Java Framework from Scratch - bit.ly/2N9xvR6
Selenium Python - bit.ly/2oyMp5x
Selenium Tips - bit.ly/2owxc50
Selenium Builder - bit.ly/2MKNtlq
Katalon Studio - bit.ly/2wARFdi
Robot Framework with RIDE- bit.ly/2Px6Ue9
Robot Framework with Eclipse - bit.ly/2N8DZxb
Protractor - bit.ly/2KtqVkU
TestProject - bit.ly/2DRNJYE
----------- API TESTING -----------
Web Services (API) - bit.ly/2MGafL7
SoapUI - bit.ly/2MGahmd
Postman - bit.ly/2wz8LrW
General - bit.ly/2PYdwmV
Katalon Studio API Testing - bit.ly/2BwuCTN
----------- MOBILE TESTING -----------
Appium - bit.ly/2ZHFSGX
Mobile Playlist - bit.ly/2PxpeUv
----------- CI | CD | DEVOPS -----------
Jenkins Beginner - bit.ly/2MIn8EC
Jenkins Tips & Trick - bit.ly/2LRt6xC
Docker - bit.ly/2MInnzx
Kubernetes - bit.ly/2MJIlMK
------------VIRTUALISATION------------
Virtualization on windows - bit.ly/2SItIL9
----------- VERSION CONTROL SYSTEM -----------
Git & GitHub - bit.ly/2Q1pagY
GitLab - bit.ly/2kQPGyQ
----------- PERFORMANCE TESTING -----------
JMeter Beginner - bit.ly/2oBbtIU
JMeter Intermediate - bit.ly/2oziNVB
JMeter Advanced - bit.ly/2Q22Y6a
JMeter Tips & Tricks - bit.ly/2NOfWD2
Performance Testing - bit.ly/2wEXbLS
----------- PROGRAMMING -----------
Java Beginners - bit.ly/2PVUcXs
Java Tips & Tricks - bit.ly/2CdcDnJ
GROOVY - bit.ly/2FvWV5C
JAVASCRIPT - bit.ly/2KJDZ8o
PYTHON - bit.ly/2Z4iRye
----------- IDE -----------
Visual Studio Code - bit.ly/2V15yvt
----------- BUILD TOOLS -----------
Maven - bit.ly/2NJdDRS
Gradle - bit.ly/30l3h1B
----------- OTHERS -----------
Redis- bit.ly/2N9jyCG
Misc - bit.ly/2Q2q5xQ
Tools & Tips - bit.ly/2oBfwoR
QnA Friday- bit.ly/2NgwGpw
Sunday Special - bit.ly/2wB23BO
Ask Raghav - bit.ly/2CoJGWf
Interviews - bit.ly/2NIPPxk
All Playlists - bit.ly/2LSiezA
---------- Connect with Raghav -----------
Udemy Courses - www.udemy.com/user/raghav-pal-3/
Twitter - / learnwithraghav
KZfaq - / automationstepbystep
Never Stop Learning
Raghav

Пікірлер: 152
@michaelmendoza9824
@michaelmendoza9824 Жыл бұрын
Excellent, clear, easy to understand, and follow instructions. This is an amazing Postman learning resource! Thank You Raghav.
@RaghavPal
@RaghavPal Жыл бұрын
You're very welcome
@svetlanamazhaykina6918
@svetlanamazhaykina6918 7 ай бұрын
Thanks for your work, Raghav! Well done!
@RaghavPal
@RaghavPal 7 ай бұрын
Thanks a lot Svetlana
@sabhyatasaxena2190
@sabhyatasaxena2190 Жыл бұрын
Really, your teaching way is so simple and by watching your videos, everything cleared... Thanks
@RaghavPal
@RaghavPal Жыл бұрын
You are most welcome Sabhyata
@ameyadani10
@ameyadani10 2 жыл бұрын
Excellent session, thanks a lot raghav!
@RaghavPal
@RaghavPal 2 жыл бұрын
Most welcome!
@amarnath1494
@amarnath1494 10 ай бұрын
Thanks for your time and contribution Raghav.
@RaghavPal
@RaghavPal 10 ай бұрын
Most welcome Amarnath
@rangaswamy3839
@rangaswamy3839 Жыл бұрын
Thank you so much for sharing your valuable knowledge raghav
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome Ranga
@kirstinebrrup9656
@kirstinebrrup9656 Ай бұрын
Great teaching skills!!! Thank you.
@RaghavPal
@RaghavPal Ай бұрын
You're very welcome Kirstine
@Nadeemkhan-fs2ys
@Nadeemkhan-fs2ys Жыл бұрын
Awesome Contents, Keep it Up !!!!!!
@RaghavPal
@RaghavPal Жыл бұрын
Appreciate it Nadeem
@user-hf8ev6ro8l
@user-hf8ev6ro8l 6 күн бұрын
Thank you for sharing details .This is really helpful
@RaghavPal
@RaghavPal 6 күн бұрын
Most welcome Divya
@MisbahulIhsan
@MisbahulIhsan 2 жыл бұрын
Awesome, everyday 1 videos.
@RaghavPal
@RaghavPal 2 жыл бұрын
More to come!
@susyberts
@susyberts Жыл бұрын
Thank you!!
@RaghavPal
@RaghavPal Жыл бұрын
You're welcome!
@shahzaibidreesahmed4827
@shahzaibidreesahmed4827 Жыл бұрын
Great explanation 👌
@RaghavPal
@RaghavPal Жыл бұрын
Thanks Shahzaib
@junnamma4750
@junnamma4750 Жыл бұрын
Thank you so much it's very usefull
@RaghavPal
@RaghavPal Жыл бұрын
You are most welcome
@shriyashbagal3927
@shriyashbagal3927 2 жыл бұрын
Superb sir
@RaghavPal
@RaghavPal 2 жыл бұрын
Thanks Shriyansh
@dinislamzan9452
@dinislamzan9452 2 жыл бұрын
thank you!
@RaghavPal
@RaghavPal 2 жыл бұрын
You're welcome!
@shreyanshprajapati2022
@shreyanshprajapati2022 Жыл бұрын
very clear picture nice , thank you
@RaghavPal
@RaghavPal Жыл бұрын
Glad you like it Shreyansh
@shreyanshprajapati2022
@shreyanshprajapati2022 Жыл бұрын
@@RaghavPal yes love it thank you :)
@nidhidani2068
@nidhidani2068 8 ай бұрын
@Raghav, In my collection there are multiple requests. Some if them need to be tested with multiple sets if data. In this case, should I create multiple csv files (for the required requests)? How to specify those files while execution of collection with newman?
@RaghavPal
@RaghavPal 8 ай бұрын
Nidhi Yes, it is recommended to create separate CSV files for each request that requires multiple sets of data. This helps to organize your test data and makes it easier to manage. When executing the collection with Newman, you can specify the CSV files using the `-d` option. For example, if you have two requests that require CSV data, you would use the following command: ```bash newman run CollectionRunner.json -d data1.csv -d data2.csv ``` This command will run the collection runner and pass the data from `data1.csv` to the first request that requires CSV data, and the data from `data2.csv` to the second request that requires CSV data. You can also use wildcards to specify multiple CSV files at once. For example, the following command will pass all CSV files in the current directory to the first request that requires CSV data: ```bash newman run CollectionRunner.json -d *.csv ``` This can be useful if you have a large number of CSV files and you want to test against all of them at once. Here is an example of how to use multiple CSV files in a Postman collection: 1. Create a new CSV file for each set of data that you want to test. 2. In your Postman collection, add a new pre-request script for each request that requires CSV data. 3. In the pre-request script, read the data from the CSV file and use it to populate the request body or query parameters. 4. When executing the collection with Newman, use the `-d` option to specify the CSV files. Using multiple CSV files can be a powerful way to test your API with a variety of data. By following these steps, you can ensure that your API is able to handle different types of input and that it is working correctly for all cases.
@shalujain9276
@shalujain9276 Жыл бұрын
HI Raghav, Thanks for excellent tutorials. Really appreciate your way of teaching by creating small videos to easily digest new concepts. just having one doubt against this data driven concept as many times we face this while working in real time project. What if we just want to run the request for some rows and not all like first 5 rows or 1,3,5 row but need to have all the rows written in datafile. how do we achieve that in postman to dynamically select the rows?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Shalu, you will need to add a script for that I could not find a direct example, but this will help you community.postman.com/t/skipping-iteration-on-collection-runner/8521
@shalujain9276
@shalujain9276 Жыл бұрын
​@@RaghavPal Thanks for your quick response. got a high level idea, will try it on my end.
@padmavathysankaralingam975
@padmavathysankaralingam975 2 жыл бұрын
Hi Raghav! You are an amazing teacher!! I have this doubt, Can we use both environment file and data file in the newman run command something like newman run collection.json -e env.json -d data.csv Will this work, it will be really helpful! Thanks in advance ☺️
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Padmavath, yes, you can you can use -d flag and provide location of your csv or json file $ newman run mycollection.json -d data.json Steps to run test cases from command line :- • Open CMD • Now reach to the folder where your JSON are saved • Now hit command as below newman run Test_Collection.postman_collection.json -e Environment.postman_environment.json -g globals.postman_globals.json -d demoData.csv -reporters cli,html In above command -e represents environment variable, -g global variable, -d csv data file name, -reporters cli,html represents output as console and
@hellotest
@hellotest Жыл бұрын
Hi Raghav, Thanks for the Data Driven Test session. Can you let me know how to save the JSON response back to .csv from data driven test using .csv file?
@RaghavPal
@RaghavPal Жыл бұрын
this can help stackoverflow.com/questions/69488415/how-do-i-export-a-response-on-postman-to-a-clearly-laid-out-csv-xls-file
@aravapallimanikanta1378
@aravapallimanikanta1378 Жыл бұрын
Hi Raghav, Tutorial is helpful, I have question if I want to check multiple status codes & responses for single API by using the above way How to do it?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Aravapalli, can add the data and assertions (codes) in csv and add test scripts to validate status codes from csv
@100janyam
@100janyam 8 ай бұрын
Hi Raghav, i did the same exact thing you did, except I used url environment variable also, but it is throwing error, can we use mix of variables like some from environment, folder and some from data files in runtime?
@RaghavPal
@RaghavPal 8 ай бұрын
Sowjanya Yes, you can use a mix of variables from different sources, including environment variables, folders, and data files, when constructing URLs in Postman. Postman provides a flexible environment for building dynamic requests, allowing you to combine various data sources to create complex URLs. Here's a breakdown of how to use different variable types in Postman URLs: **Environment variables:** - Environment variables are global values stored in Postman's environment settings. To use an environment variable in a URL, simply enclose its name within double curly braces (`{{}}`). For example, if you have an environment variable named `API_URL` with the value `example.com/api`, you can use it in a URL like this: ``` {{API_URL}}/products ``` **Folder variables:** - Folder variables are specific to a particular collection or folder in Postman. To use a folder variable in a URL, follow the same syntax as environment variables but prefix the variable name with `folder.` For instance, if you have a folder variable named `BASE_URL` with the value `api.example.com/`, you can use it like this: ``` {{folder.BASE_URL}}/v1/users ``` **Data file variables:** - Data file variables are extracted from JSON or CSV files and can be used in URLs. To access data file variables, you'll need to import the data file into Postman and reference the variable using its name from the data file. For example, if you have a data file named `data.json` with a property named `URL` containing the value `api.example.com/products`, you can use it in a URL like this: ``` {{data.URL}} ``` Remember, you can combine these variable types to create complex URLs that dynamically adapt based on different data sources. Postman's variable syntax allows you to seamlessly integrate environment, folder, and data file variables into your requests, enabling flexible and dynamic API testing. I hope this clarifies how to use different variable types in Postman URLs. Feel free to ask if you have any further questions.
@mv8167
@mv8167 Жыл бұрын
Always, you have such a great presentation method. I am curious, when I use a time variable that I created in my Pre-Request Script, the body tab shows my variable name 'timeVariable' italicized, as in "time":"{{timeVariable}}", Is this due to the variable 'timeVariable' being dynamic?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Mike In Postman, when you see a variable name italicized in the request body, such as `"time":"{{timeVariable}}"`, it indicates that the variable is a dynamic value and will be replaced with its actual value during the request execution Postman allows you to define variables and use them in various parts of your requests, including the request body. By enclosing the variable name in double curly braces (`{{ }}`), Postman knows that it needs to replace the variable placeholder with the actual value when the request is sent. In your case, the variable `timeVariable` is likely defined in your Pre-Request Script or some other script, and its value will be assigned dynamically at runtime. The italicized representation in the body tab is Postman's way of indicating that the value will be populated dynamically during the request execution. When you send the request, Postman will replace `"{{timeVariable}}"` with the actual value of the variable, resulting in a valid JSON payload. This dynamic variable feature in Postman is useful for scenarios where you need to use changing values or computed values in your requests. It allows for flexibility and automation in your API testing and requests
@mv8167
@mv8167 Жыл бұрын
@@RaghavPal Yes, I use a dynamic variable and create it in my collection level's Pre-Request Script tab. In the console log report I see that all timeVariable arr created, one per test. But when I look at the Post's Body summary esults, the Time:{{timeVariable}} is empty. Do I need to set this variable in each test? Any ideas? Thank you
@RaghavPal
@RaghavPal Жыл бұрын
In Postman, variables enclosed in double curly braces "{{ }}" are treated as environment or global variables. If you see the variable name "timeVariable" italicized in the request body like "time":"{{timeVariable}}", it indicates that the variable is not being resolved or substituted with its actual value. To ensure that the variable is resolved correctly and its value is populated in the request body, you need to make sure of the following: 1. Variable Scope: Check the scope of the "timeVariable" variable. If it is defined at the collection level's Pre-Request Script tab, it should be available to all requests within that collection. 2. Variable Assignment: Make sure that you are correctly assigning a value to the "timeVariable" variable in the Pre-Request Script. You can use the `pm.environment.set` or `pm.globals.set` methods to set the value of the variable. 3. Request Execution Order: Ensure that the Pre-Request Script is executed before the request itself. In the collection runner or Newman, the order of execution should be such that the Pre-Request Script is executed first, and then the request using that variable. If you have confirmed the above points and still face the issue where the "timeVariable" value is not populated in the request body, you can try the following troubleshooting steps: 1. Check Variable Syntax: Ensure that the variable syntax "{{timeVariable}}" is correct and matches the variable name exactly as it is defined. 2. Check Request Body Formatting: Make sure that the request body syntax is correct and that the variable is being used in the appropriate place. Double-check the quotes and any other syntax specific to the request body format (e.g., JSON, XML). 3. Verify Variable Usage: Check if the "timeVariable" is used correctly in the request body. Ensure that it is within quotes (if required) and is not being overwritten or modified elsewhere in the request. 4. Verify Variable Reference: Ensure that the request where you are using the "timeVariable" is actually referring to the correct environment or global variable. Check if there are any naming conflicts with other variables
@kavitha-99
@kavitha-99 7 ай бұрын
Hi Raghav, I really enjoyed learning with your youtube series In my folder, I have both two scripts. One uses the csv file and the other uses the json file. In that case, how to upload both the files if I wanted to run both the scripts? I tried to run the folder (which has the above two scripts) and when I try to upload both files, it replaces the prev file, which means I can only execue one script. So, it looks like it does not allow. Just wanted to double check with you. Thank you!
@RaghavPal
@RaghavPal 7 ай бұрын
Kavitha Unfortunately, Postman doesn't allow directly uploading multiple files for use within different scripts in the same folder. However, there are a couple of workarounds you can try: 1. Use environment variables: Define environment variables in Postman for each file path (e.g., CSV_FILE_PATH and JSON_FILE_PATH). Within your scripts, access the file path using the environment variable name and use it to read the data from the appropriate file. This allows you to switch between files easily by updating the environment variable values with the desired file paths. 2. Combine scripts into one: Merge your two scripts into a single script that conditionally chooses which file to read based on a parameter or environment variable. You can use conditional statements like if or switch to execute the relevant file reading code based on the chosen file. This approach keeps everything within one script but might require some code restructuring to handle the logic for choosing and reading the different files. 3. Use Pre-request scripts: Create separate pre-request scripts for each file. Each script can read the appropriate file and store the data in a variable or environment variable. In your main script, access the data stored in the variable or environment variable set by the pre-request script depending on the desired file. This approach allows for modularity and separation of concerns but requires additional pre-request scripts for each file. 4. Use a Postman Collection Runner: If you have multiple scripts that need to run with different files, consider using a Postman Collection Runner. You can create a Collection with each script as an item and configure each item to use a specific environment variable value for the file path. This allows you to run multiple scripts with different file inputs in one go. Ultimately, the best approach depends on your specific needs and the complexity of your scripts. Choose the method that best suits your workflow and provides the most flexibility for handling different files within your Postman testing setup.
@yalcinkaya3442
@yalcinkaya3442 10 ай бұрын
Excellent explanation ! By the way, I have a question, how do you draw that red square like 1:18?
@RaghavPal
@RaghavPal 10 ай бұрын
can use screen presentation tools
@itsme-vc8fs
@itsme-vc8fs Жыл бұрын
Raghav there is a senario like this, when i sign up with email password and confirm password every a new token gets generated, i need to give this random token to run another verify email api. How can i create csv file for this? How can we give comma in csv file as u have shown in note pad? With out endpoint can create only for variables like email, password and confirm password?. Please answer this
@RaghavPal
@RaghavPal Жыл бұрын
Hi, you will need to do chaining here, get the token from 1st api and refer in others
@snw-xj1yy
@snw-xj1yy Жыл бұрын
Hi Raghnav, follow the step...but why got same response body for iteration 1 and 2 even after read the csv file?
@RaghavPal
@RaghavPal Жыл бұрын
Hi, check the Postman Console - kzfaq.info/get/bejne/jtOiZpaQlpPbqqc.html
@ammarsadeq6078
@ammarsadeq6078 5 ай бұрын
In windows we can save the excel as CSV by selecting CSV under save as type which is similar to what you showed in your Mac. No need to write.csv
@RaghavPal
@RaghavPal 5 ай бұрын
okay... thanks for adding Ammar
@Stan_sprinkle
@Stan_sprinkle Жыл бұрын
10:11 so it assumes row 1 in the csv is headers? You don’t have set it somewhere if your file has headers?
@RaghavPal
@RaghavPal Жыл бұрын
To make the first row of CSV as header in Postman data driven testing, you can follow these steps: Open the collection runner in Postman. Select the data file that you want to use for data driven testing. Click on the gear icon to open the collection runner settings. Under the "Data" tab, select the "CSV" file format. Check the "First row as header" option. Click on "Save" to save the changes. Now, when you run the collection with data file, Postman will use the first row of CSV file as header for data variables.
@nageshpai3859
@nageshpai3859 Жыл бұрын
Hi Raghav, If I want to test multiple API with data driven framework, do i need to create multiple .csv file? Thank you
@RaghavPal
@RaghavPal Жыл бұрын
Hi Nagesh, you can create csv files for testing with multiple sets of data
@balakumar1906
@balakumar1906 9 ай бұрын
Hi @@RaghavPal , Thanks for the effort put in for making such diverse content across testing. I have a similar doubt on Data-Driven Testing on postman. Like we test using selenium, there we use multiple sheet in a single csv file to separate test data for multiple request. same thing can we do in postman. In postman it will accept if we are storing data in multiple sheets ?
@DanielAlves-vk4kh
@DanielAlves-vk4kh Жыл бұрын
Hi Raghav i have a doubt, when i run the collection everything is going fine but it gives me error 404 on the endpoint. if i put the endpoint writen manual it goes well. What can i do?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Daniel There are a few things you can do to troubleshoot this issue: 1. Check the endpoint URL. Make sure that the URL you are using is correct and that it points to the correct API endpoint. You can check the API documentation to verify the correct URL. 2. Check the request method. Make sure that the request method you are using is correct. The request method is the HTTP verb that you are using to make the request, such as GET, POST, PUT, or DELETE. 3. Check the request headers. Make sure that the request headers you are using are correct. The request headers are the additional information that you are sending with the request, such as the authorization header. 4. Check the request body. Make sure that the request body you are using is correct. The request body is the data that you are sending with the request. If you have checked all of these things and you are still getting an error 404, then the issue may be with the API itself. You can try contacting the API provider to see if they can help you troubleshoot the issue. Here are some additional things you can try: * Try using a different browser to make the request. * Try using a different network connection to make the request. * Try clearing your browser's cache and cookies. I hope this helps! Let me know if you have any other questions.
@user-bj3mh3nm1n
@user-bj3mh3nm1n 22 күн бұрын
Thanks Raghav. How do we come to know that we need to use /QA and /reg. In reqres website the endpoint url is /api/register
@RaghavPal
@RaghavPal 22 күн бұрын
Sid, I just tried that for the demo to make people understand
@dhavalrajput272
@dhavalrajput272 Жыл бұрын
may I know why /qa was put in the URL for making post call ? what is the significance of qa ?
@RaghavPal
@RaghavPal Жыл бұрын
just to show the functionality
@dhananjaymalhotra7854
@dhananjaymalhotra7854 Жыл бұрын
Thank you so much for the video. I have one query though. I have 2 requests in a collection and second request is dependent on the first one. I am running the collection for 12 iterations. I want to write a script to reset two collection variables after all the iterations have run. Could you please guide me on where to include the reset code?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Dhananjay, You can use the "Postman Tests" feature to write a script that resets the collection variables after all iterations have run. Here's an example of how you can write a script to reset the collection variables after 12 iterations: In the first request, add a test script that increments a counter variable /* pm.test("Increment counter", function () { if (!pm.iterationData.get("counter")) { pm.iterationData.set("counter", 0); } pm.iterationData.set("counter", pm.iterationData.get("counter") + 1); }); */ In the second request, add a test script that checks if the counter variable has reached 12 and resets the collection variables if it has. /* pm.test("Reset variables", function () { if (pm.iterationData.get("counter") === 12) { pm.iterationData.set("variable1", ""); pm.iterationData.set("variable2", ""); pm.iterationData.set("counter", 0); } }); */ you may need to adjust the script as per your requirements. The pm.iterationData is a special type of variable storage in postman that is shared across all requests in the collection. You can also reset the variables using the pm.variables.unset() method /* pm.test("Reset variables", function () { if (pm.iterationData.get("counter") === 12) { pm.variables.unset("variable1"); pm.variables.unset("variable2"); pm.iterationData.set("counter", 0); } }); */ Make sure the test script is added to the correct request and the counter is reset after all the iteration are completed.
@dhananjaymalhotra7854
@dhananjaymalhotra7854 Жыл бұрын
@@RaghavPal Thank you so much Raghav for such a detailed answer. I sincerely appreciate your time and effort. I have observed that value of counter is not getting incremented by 1. I have even tried by converting the counter variable to int: pm.iterationData.set("counter", Number.parseInt(pm.iterationData.get("counter"))+1);
@RaghavPal
@RaghavPal Жыл бұрын
try some more examples online, also use Postman Console - kzfaq.info/get/bejne/jtOiZpaQlpPbqqc.html
@shreenaths6598
@shreenaths6598 Жыл бұрын
Hey Raghav, awesome video... I have one doubt, how i read excel file from email attachment using postman api... I get the token of same but not fetch the content from file... How I do? Plz make one video on same....
@RaghavPal
@RaghavPal Жыл бұрын
Hi Shreenath, I will check on this
@pavang2827
@pavang2827 Жыл бұрын
Hi Raghav I am Facing the following issues as i mentioned bellow could you please help me ReferenceError: responsebody is not defined Script is: tests["verify email"] = responseBody.has(data.email) tests["verify email"] = responseBody.has(data["email"])
@RaghavPal
@RaghavPal Жыл бұрын
Hi Pavan, where exactly have you placed these scripts, in case its in Pre-request script section, it will not work pls check this - stackoverflow.com/questions/71881608/responsebody-is-not-defined-in-postman community.postman.com/t/unable-to-define-json-parse-responsebody-in-collection-tests-tab/9405
@krupadv1784
@krupadv1784 Жыл бұрын
Hi Raghav, i have this doubt regarding nested json request, how to pass the value from the json file to a request structure in case of a nested request structure
@RaghavPal
@RaghavPal Жыл бұрын
I will check on this Krupa
@krupadv1784
@krupadv1784 Жыл бұрын
Okay..
@ammarsadeq6078
@ammarsadeq6078 5 ай бұрын
Nothing showed up in my console but then I found out against console the option for hide network was checked. Also in console under response body. It displays {{password}} and not the actual value. Wondering if it’s pulling the password from excel but due to security or some setting it’s not displaying the password
@RaghavPal
@RaghavPal 5 ай бұрын
I will check on this Ammar .. can also check in documenation
@andyrockstar78
@andyrockstar78 17 күн бұрын
For the last step to verify response when we use the code as given in this video it gives message, Using data is deprecated , Use "pm.iterationData" instead & Using tests is deprecated . Use pm.test() instead. Can you please clarify what correction needs to be done in latest version of postman. Thanks
@RaghavPal
@RaghavPal 15 күн бұрын
Andy Let's break down the issue step by step: Error Message: When running a test in Postman, you're seeing the following error messages: 1. "Using data is deprecated, Use 'pm.iterationData' instead." 2. "Using tests is deprecated, Use pm.test() instead." What do these errors mean? These errors indicate that you're using outdated syntax in your Postman tests. The `data` and `tests` variables are deprecated, meaning they're no longer supported in the latest version of Postman. What's the correction? To fix these errors, you need to update your test code to use the new syntax: 1. Replace `data` with `pm.iterationData`: In your test code, replace any instances of `data` with `pm.iterationData`. For example: Before: ```javascript console.log(data); ``` After: ```javascript console.log(pm.iterationData); ``` 2. Replace `tests` with `pm.test()`: In your test code, replace any instances of `tests` with `pm.test()`. For example: Before: ```javascript tests["Status code is 200"] = responseCode.code === 200; ``` After: ```javascript pm.test("Status code is 200", function () { pm.expect(responseCode.code).to.equal(200); }); ``` Additional Tips: * Make sure to update all occurrences of `data` and `tests` in your test code. * If you're using a Postman collection, you might need to update the collection's test scripts as well. * If you're still experiencing issues, try checking the Postman documentation or seeking help from the Postman community. By making these changes, you should be able to resolve the deprecation warnings and ensure your tests work correctly with the latest version of Postman -
@vasanthk6169
@vasanthk6169 Ай бұрын
I have expected values in seperate csv file and input values in seperate csv file.input needs to be passed from the csv file(the file which having input values) to the post request body and I need to validate the values in the response against the csv file(the file which having expected values). How to do this?
@RaghavPal
@RaghavPal Ай бұрын
Vasanth To achieve this in Postman, follow these steps: 1. Import CSV Files: - First, make sure you have your input and expected value CSV files ready. - In Postman, create a new collection or open an existing one. - Create a new request (e.g., a POST request) within the collection. 2. Configure the Request: - In the request, go to the "Body" tab. - Choose the "form-data" option. - For each input field, set the "key" to match the field name in your request body. - For the "value," click "Select File" and choose the input CSV file containing your data. 3. Map CSV Data to Request Body: - Use the `{{...}}` syntax to reference the CSV column headers as variables in your request body. - For example, if your CSV has a column named "EquipmentModel," use `{{EquipmentModel}}` in the request body. 4. Run the Request: - Click the "Send" button to execute the request. - Postman will replace the variables with actual values from the CSV file. 5. Validate the Response: - In your response handling logic (e.g., tests or scripts), compare the actual response values with the expected values from your expected value CSV file. Remember to adjust the steps according to your specific use case. If you encounter any issues, refer to the official Postman documentation --
@vasanthk6040
@vasanthk6040 Ай бұрын
Can i import the 2 csv files?.if yes, how to extract the data from the 2nd file(the file containing expected values)?
@RaghavPal
@RaghavPal Ай бұрын
You can import both CSV files into Postman. Let's focus on extracting data from the second file (the one containing expected values). Here's how you can do it: 1. Import Both CSV Files: - Make sure you have both your input and expected value CSV files ready. - In Postman, create a new collection or open an existing one. - Create a new request (e.g., a POST request) within the collection. - Go to the "Body" tab in the request. 2. Import the Expected Value CSV File: - Click on the "form-data" option. - For each expected value field, set the "key" to match the field name in your response. - For the "value," click "Select File" and choose the expected value CSV file containing your data. 3. Access Expected Values in Tests: - In your response handling logic (e.g., tests), you can access the expected values using the `pm.iterationData` object. - For example, if your CSV has a column named "ExpectedResult," you can access it like this: ```javascript const expectedValue = pm.iterationData.get('ExpectedResult'); ``` 4. Compare Actual vs. Expected Values: - In your tests, compare the actual response values with the expected values. - For example: ```javascript pm.test('Verify Expected Result', () => { const actualResult = pm.response.json().result; pm.expect(actualResult).to.eql(expectedValue); }); ``` Remember to adjust the steps and variable names according to your specific CSV column headers. This way, you can validate the response against the expected values from your CSV file --
@manpreetwahra8989
@manpreetwahra8989 Жыл бұрын
hi i have one confusion when i run this data driven testing for single api is show me 400 error it only work for me for collections.. am i doing something in wrong way.
@RaghavPal
@RaghavPal Жыл бұрын
Hi Manpreet, will need more details to troubleshoot
@prernasharma1307
@prernasharma1307 2 жыл бұрын
At last my email assertion failed.... Had few bugs in my json.... Was able to resolve that but not sure why the email assertion failed. I am getting the correct email in the request and response body both
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Prerna, will need to see in detail
@boddulurisivaji8757
@boddulurisivaji8757 6 ай бұрын
Hello Raghav, at 3:10 Are you considering the Environment as an Endpoint. If so, I am expecting it to reflect in the environment section. Could you please explain
@RaghavPal
@RaghavPal 6 ай бұрын
at 3:10 i don't see parameterizing end points. Please check, it may be some other section and let me know your doubt
@boddulurisivaji8757
@boddulurisivaji8757 6 ай бұрын
@@RaghavPal Thank you so much for your response. I am referring to qa/prod added to the end point. I didn't understand the concept of adding qa/prod to the end point and response as a result of adding. This might be a basic one however I didn't get this. Appreciate your time and effort
@RaghavPal
@RaghavPal 6 ай бұрын
ok,, that was just an example.. and it is a dummy rest api
@sonisingh5464
@sonisingh5464 2 жыл бұрын
Hi sir , how many videos are remaining to complete postman?? I am having 1 more query for API testing learning postman is enough or do I need to learn something else. Plz reply
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Soni, I have completed the playlist, you can check all here - automationstepbystep.com/
@keerthanapolisetty8142
@keerthanapolisetty8142 11 ай бұрын
I am getting failure status from second mail onwards. What i have to do?
@RaghavPal
@RaghavPal 11 ай бұрын
Keerthana will need more details and reference
@usamaanees1032
@usamaanees1032 Жыл бұрын
Hi Raghav, How can import data from a specific row?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Usama, this can help praveendavidmathew.medium.com/postman-trick-and-tips-how-to-run-a-specific-iteration-data-from-newman-ac0cbaf9effb stackoverflow.com/questions/57923727/how-to-use-data-in-csv-file-row-wise-to-be-used-per-request-via-newman
@shevanez
@shevanez 2 ай бұрын
Thanks for the video lesson. But the test written at 18:55 is not working. (data.email is deprecated)This particular one worked: var responseBody = pm.response.json(); pm.expect(responseBody.email).to.equal(pm.iterationData.get("email"));
@RaghavPal
@RaghavPal 2 ай бұрын
Hello Let's address the issue with your Postman tests and the deprecation of `data.email` 1. Deprecation of `data.email`: - The `data.email` syntax is deprecated in Postman. Instead, you should use `pm.iterationData.get("email")` to access data from your data file (e.g., CSV or JSON). - The `pm.iterationData.get("email")` method retrieves the value associated with the key `"email"` from your data file. 2. Corrected Test Example: - Based on your working example, let's update the test to use the correct syntax: ```javascript var responseBody = pm.response.json(); pm.expect(responseBody.email).to.equal(pm.iterationData.get("email")); ``` - In this test, we assume that the API response contains an `email` property, and we compare it with the value from your data file. 3. Additional Tips: - Make sure your data file (CSV or JSON) contains the necessary keys (such as `"email"`). - Verify that the API response structure matches your expectations. - If you encounter any other issues, consider checking the response body, status codes, and other relevant details. Remember to adjust your tests according to the correct syntax, and your tests should work as expected ---
@sibanidevi930
@sibanidevi930 13 күн бұрын
How to provide multiple input values to the api request handling through prerequisites instead of .csv or .json data file
@RaghavPal
@RaghavPal 13 күн бұрын
Sibani Let's break down the problem step by step. Step 1: Understand Pre-request Scripts In Postman, pre-request scripts are scripts that run before the request is sent. They can be used to set variables, manipulate data, and even generate input values for the request. Step 2: Define the Input Values Identify the input values you want to pass to the API request. For example, let's say you want to test an API endpoint that takes two parameters: `username` and `age`. You want to test the endpoint with multiple combinations of these values. Step 3: Create an Array of Input Values In the pre-request script, create an array of objects that contain the input values. For example: ```javascript let inputData = [ { username: "john", age: 25 }, { username: "jane", age: 30 }, { username: "bob", age: 35 }, // Add more objects to the array as needed ]; ``` Step 4: Use the `pm.setNextRequest()` Method In the pre-request script, use the `pm.setNextRequest()` method to set the next request in the collection. This method allows you to dynamically set the request body, headers, and other parameters. Step 5: Loop Through the Input Values Use a `for` loop to iterate through the `inputData` array and set the request body or parameters for each iteration. For example: ```javascript for (let i = 0; i < inputData.length; i++) { pm.setNextRequest({ body: { mode: 'raw', raw: JSON.stringify(inputData[i]) } }); } ``` This code sets the request body to a JSON object containing the current input values. Step 6: Run the Collection Run the collection in Postman. The pre-request script will iterate through the `inputData` array and send a separate request for each set of input values. Tips and Variations * You can also use environment variables or global variables to store the input values and access them in the pre-request script. * If you need to test a large number of input values, consider using a data-driven approach with a CSV or JSON file. Postman supports data-driven testing through its built-in support for CSV and JSON files. * You can also use Postman's built-in support for dynamic variables to generate input values. For example, you can use the `{{$randomInt}}` variable to generate a random integer value. -
@sibanidevi930
@sibanidevi930 12 күн бұрын
@@RaghavPal thanks a lot for the reply and taking the effort to explain in detail.
@harishkumaru589
@harishkumaru589 10 ай бұрын
How do we export all the response body into a csv for all the item's executed from collection run?
@RaghavPal
@RaghavPal 10 ай бұрын
Harish To export all the response body into a CSV for all the items executed from collection run in Postman, you can use the following steps: 1. Run your collection. 2. Click the **History** tab. 3. Select the collection run that you want to export. 4. Click the **Export** button. 5. In the **Export** dialog box, select **CSV** as the export format. 6. Click the **Export** button. Postman will export a CSV file containing the response body for all of the items executed in the collection run. The CSV file will contain the following columns: * **Name:** The name of the item. * **Request:** The request method and URL. * **Status:** The HTTP status code. * **Response Body:** The response body. You can also use Newman to export the response body for all of the items executed in a collection run to a CSV file. To do this, you can use the following command: ``` newman run collection.json --reporters cli,csv --reporter-csv-export output.csv ``` This command will run the collection and export the response body for all of the items executed in the collection run to a CSV file named `output.csv`. I hope this helps
@harishkumaru589
@harishkumaru589 10 ай бұрын
@@RaghavPal Hi, In history tab there is no option to export collection. However in the main collection there is an option to export collection but it exports a json file which has no data in neither response body nor in any tabs
@RaghavPal
@RaghavPal 10 ай бұрын
will check and update this
@user-jr1cs2wm7f
@user-jr1cs2wm7f 5 ай бұрын
Hey Raghav, suppose we submit form by Web UI. The data will be populated at the end in the backend salesforce and lead will generate. Please guide that is it possible to validate the data by postman that the same/correct data is populated in the salesforce that we submitted? If yes, then how? Please guide. Thanks and Regards
@RaghavPal
@RaghavPal 5 ай бұрын
Qasim ## Validating data in Salesforce before lead generation using Postman Yes, it's possible to validate data before it reaches Salesforce and triggers lead generation using Postman. Here are two approaches to consider: 1. Validate before submitting to Salesforce: - Pre-validation logic: Write JavaScript code on the web page, triggered before form submission, to perform basic validation (e.g., required fields, format checks). You can use tools like browser developer console to inspect and modify this code. - Postman Interceptor: Install a Postman Interceptor extension (e.g., ModHeader), which allows you to intercept form submissions before they reach the server. Configure it to: - Capture the form data - Perform your own validation against Salesforce field definitions or custom rules - If validation fails, modify or block the request 2. Validate after receiving Salesforce response: - Use the SOAP API: After submitting the form, make a SOAP API call to Salesforce directly using Postman to query the newly created lead. Compare the retrieved data with the submitted data to identify any discrepancies. - Use the REST API: Alternatively, use the Salesforce REST API with the `query` endpoint to filter leads based on unique identifiers like email address or phone number. Extract the lead details and compare them against the submitted data. Additional Tips: - Consider Salesforce validation rules: Make sure your validation logic aligns with any existing validation rules or triggers configured in Salesforce to avoid redundant checks. - Handle complex logic: For intricate validation checks, consider tools like Apex triggers or custom validation rules within Salesforce instead of relying solely on frontend or Postman validation. - Security: Be cautious when modifying form data using Interceptor extensions, as it might break website functionality or raise security concerns. Remember: These are general approaches, and the specific implementation will depend on your web application technology, form submission method, and desired validation rules. I hope this helps..
@user-jr1cs2wm7f
@user-jr1cs2wm7f 5 ай бұрын
@@RaghavPal Can I watch your videos of data driven testing using Postman in this regards?
@RaghavPal
@RaghavPal 5 ай бұрын
yes
@user-jr1cs2wm7f
@user-jr1cs2wm7f 5 ай бұрын
@@RaghavPal I hope you are doing well. I have watched this video regarding to data driven (kzfaq.info/get/bejne/gNlkgrFk2ru2YZc.html). In this video, you have used POST method in data driven testing by using CSV and JSON. Is it possible to use GET method by following the same steps (that you mentioned) and validate the response with their status code? Actually, I want to validate the data that I submitted (by the front end of web application). When I pass that submitted data by postman by attaching CSV file or JSON. I want the status = 200 OK from the salesforce API as response and I will validate that code. Is it possible? Please guide me. Thanks and Regards Qasim
@RaghavPal
@RaghavPal 5 ай бұрын
Yes, it's definitely possible to use the GET method with data-driven testing and validate the response with its status code, following the same steps as the video you linked. Here's how you can achieve what you're looking for: 1. Prepare your Data: - Instead of using a POST request, you'll need to format your data in a way that can be appended to the URL as query parameters. This means encoding the key-value pairs from your CSV or JSON file into a format like `key1=value1&key2=value2...`. - If your data contains complex structures or nested objects, you might need to choose a suitable encoding format like URL encoding or JSON query parameters. 2. Use GET Requests in Your Test Script: - Modify the test script to use the `GET` method instead of `POST`. - Build the URL dynamically by appending the prepared query parameters to the base API endpoint. - Utilize libraries like `pandas` (for CSV) or `json` (for JSON) to read your data from the files. 3. Validate the Response: - Assert that the response status code is 200 to verify successful data submission. - If needed, you can further extract specific data from the response and compare it with expected values based on your submitted data. Here's an example with Postman: Test Data (CSV): ``` name,email,city John Doe,john.doe@example.com,New York Jane Doe,jane.doe@example.com,London ``` API Endpoint: ``` your-salesforce-api.com/register ``` Postman Request: - Set the method to GET. - In the URL, add the base endpoint and construct the query parameters dynamically using your data. For example: ``` your-salesforce-api.com/register?name=John%20Doe&email=john.doe@example.com&city=New%20York ``` - Send the request. Validation: - Check if the response status code is 200. - If successful, you can further analyze the response body to verify that the submitted data is reflected correctly. Remember: - Adjust the specific details based on your API documentation and data format. - Ensure proper data encoding and parameter handling. - Choose appropriate libraries and tools for your testing environment. I hope this explanation clarifies how to use the GET method with data-driven testing and validate the response for your Salesforce API scenario.
@Barathiartsdrawing
@Barathiartsdrawing 6 ай бұрын
hi in my organization thy want to pass different set of datas from excel file and automate api testing Can u tell me in simple words How i should do it
@RaghavPal
@RaghavPal 6 ай бұрын
Here's how to automate API testing in Postman using data from an Excel file: 1. Prepare Excel Data: - Create an Excel file with test data in a structured format (e.g., headers, rows). - Save the file as a CSV (Comma Separated Values) file. 2. Import Data: - In Postman, open the Collections tab. - Click the three dots next to your collection and select "Import". - Choose "Import from CSV". - Select the CSV file and choose the sheet containing the data. - Map the CSV columns to variables in your request body (e.g., `{{username}}`, `{{password}}`). 3. Run Collection: - Select the collection to run. - Click the "Run" button. - Choose "Run collection". - In the "Iterations" field, enter the number of times to run the collection (usually the number of rows in your CSV). - Click "Run Collection". 4. Use Data in Requests: - Access variables directly in request bodies, headers, or URLs: ``` { "username": "{{username}}", "password": "{{password}}" } ``` 5. Add Tests: - In the "Tests" tab of each request, write test scripts using JavaScript to verify responses. - Use data variables for dynamic assertions: ```javascript pm.test("Status code is 200", function () { pm.response.to.have.status(200); }); ``` 6. Visualize Results: - Review test results in the "Runner" tab. - Analyze failures and debug as needed. Additional Tips: - Environment Variables: Use environment variables for sensitive data or configuration. - Data-Driven Loops: Use loops for more complex data-driven tests. - Pre-request Scripts: Prepare data before each request (e.g., generate unique values). - Postman Runner: Automate testing with the command-line Runner. - Newman: Integrate testing into CI/CD pipelines for continuous feedback.
@Barathiartsdrawing
@Barathiartsdrawing 6 ай бұрын
@@RaghavPal thanks a lot.. ure super good in helping by sharing knowledge Hope you hv a great life I wl process this and come again here with results and queries Thanks again🙏
@richardakinsehinde6280
@richardakinsehinde6280 2 ай бұрын
Hi Raghav, thank you for your excellent tutorials. My tests passed but I got 4 warnings "Using "data" is deprecated. Use "pm.iterationData" instead." and "Using "tests" is deprecated. Use "pm.test()" instead." on the Console when I ran the 'Refer data in test scripts' part. See below: tests["verify email"] = responseBody.has(data.email) tests["verify email"] = responseBody.has(data["email"]) When I used the suggestions, the verify email part was not tested. Note: I'm using Postman v11.1.0
@RaghavPal
@RaghavPal 2 ай бұрын
Richard Let's address these warnings: 1. Using "data" is deprecated. Use "pm.iterationData" instead: - In Postman, the `"data"` object was previously used to store variables. However, it has been deprecated in favor of `"pm.iterationData"` for better clarity and consistency. - To fix this warning, replace any occurrences of `"data"` with `"pm.iterationData"` in your test scripts. 2. Using "tests" is deprecated. Use "pm.test()" instead: - Similarly, the `"tests"` object has been deprecated in favor of `"pm.test()"`. - Update your test scripts to use `"pm.test()"` instead of `"tests"`. Here's how you can modify your test scripts: ```javascript // Replace this: tests["verify email"] = responseBody.has(data.email); tests["verify email"] = responseBody.has(data["email"]); // With this: pm.test("verify email", function () { pm.expect(responseBody.has(pm.iterationData.get("email"))).to.be.true; }); ``` Make sure to adjust the variable names (`"email"`) according to your specific use case. By making these changes, you'll address the deprecation warnings and ensure compatibility with the latest Postman version --
@richardakinsehinde6280
@richardakinsehinde6280 2 ай бұрын
@@RaghavPal Hi Raghav, thank you so much.
@user-yq7ip3jy3r
@user-yq7ip3jy3r Ай бұрын
@@RaghavPal still doesnt work
@RaghavPal
@RaghavPal 20 күн бұрын
will need to get more logs and check the details
@Rysdo22
@Rysdo22 6 ай бұрын
Is it possible to run collection with gRPC requests?
@RaghavPal
@RaghavPal 6 ай бұрын
As of now, Postman does not directly support running collections with gRPC requests using its built-in collection runner. However, here are several workarounds and alternative approaches you can consider: 1. Manual Execution: - While you cannot automate the execution of gRPC requests within a collection, you can still manually execute them individually. - Open each gRPC request in the collection and click the "Send" button to send it. 2. External Automation: - Newman CLI: Explore integrating a third-party tool like Newman, Postman's command-line collection runner, with custom scripting to achieve gRPC collection execution. This approach involves writing scripts to handle gRPC request execution and chaining them together. - Other Automation Tools: Consider using other testing frameworks or automation tools that natively support gRPC, such as: - BloomRPC - grpcurl - grpc_cli 3. Workaround with Comments: - If you need to test multiple gRPC requests with different data combinations, you can temporarily comment out certain requests and uncomment them as needed. - This doesn't fully automate the process but can help organize your testing efforts. 4. Potential Future Support: - Postman is aware of the demand for gRPC collection execution and has an open feature request tracking its development. - Stay updated on their roadmap for potential implementation in future releases. 5. Alternative Solutions: - BloomRPC: A desktop GUI client specifically designed for gRPC testing, offering collection-like functionality and request organization. - grpcurl: A command-line tool for interacting with gRPC services, allowing you to create scripts for testing multiple requests. - Custom Scripts: Write your own scripts using programming languages like Python or Node.js, leveraging gRPC libraries for request execution and collection management.
@Rysdo22
@Rysdo22 6 ай бұрын
@@RaghavPal Thank you for your replay.
@sonalahluwalia
@sonalahluwalia 9 ай бұрын
Can i get result in excel or csv with this approach?
@RaghavPal
@RaghavPal 9 ай бұрын
To get the results of a Postman request in Excel or CSV, you can use the following approach: 1. Execute the Postman request and store the response in a variable. 2. Use the `pm.response.body.to.jsonObj()` function to convert the response body to a JSON object. 3. Use the `jsonpath` library to extract the desired data from the JSON object. 4. Write the extracted data to an Excel or CSV file using the `fs` library. Here is an example of how to export the results of a Postman request to a CSV file: ``` const response = pm.response.body.to.jsonObj(); const data = jsonpath.query(response, '$..name'); const fs = require('fs'); const csv = data.map(item => `${item}`).join(','); fs.writeFileSync('results.csv', csv); ``` You can also use the Postman Collection Runner to export the results of a collection of Postman requests to an Excel or CSV file. Here is an example of how to export the results of a collection of Postman requests to a CSV file using the Postman Collection Runner: 1. Open the Postman Collection Runner. 2. Select the collection of Postman requests that you want to export. 3. Click the **Run** button. 4. In the **Results** tab, click the **Export** button. 5. Select the **CSV** format from the list of available formats. 6. Click the **Export** button. The Postman Collection Runner will export the results of the collection of Postman requests to a CSV file.
@sonalahluwalia
@sonalahluwalia 9 ай бұрын
@@RaghavPal Thanks a ton. I will implement this.
@status6771
@status6771 4 ай бұрын
How we run two requests with external data
@RaghavPal
@RaghavPal 4 ай бұрын
In Postman, you can run multiple requests sequentially or concurrently. Let's explore how to run two requests with external data: 1. Sequential Execution: - If you want to execute requests one after the other, follow these steps: 1. Create your requests: Set up the two requests you want to run. 2. Use Variables: Define variables to hold your external data. You can use environment variables or global variables. 3. Chain Requests: In the first request, extract data (e.g., an ID or token) and store it in a variable. Then, use this variable in subsequent requests. 4. Run Collection: Execute the entire collection. Postman will run the requests in order, using the data from variables. 2. Concurrent Execution: - If you want to run both requests simultaneously (in parallel), consider using Postman Monitors or Newman (the command-line collection runner). - Postman Monitors: - Create a monitor for your collection. - Set up your requests and variables as usual. - Run the monitor, and Postman will execute the requests concurrently. - Newman: - Install Newman globally using npm (`npm install -g newman`). - Export your collection from Postman. - Run Newman with the exported collection JSON file and any necessary environment files. - Newman will execute the requests concurrently. Remember to handle any authentication, headers, and data dependencies appropriately in both scenarios
@Rajatbhr
@Rajatbhr 2 жыл бұрын
i need ur help for devolpe my tool .. i maild u already but u not responding
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Rajat, I may not be able to help in tools development, Can check online support
@brijeshkumar-qd2zm
@brijeshkumar-qd2zm Жыл бұрын
Sir data driven test ki class hindi me kr dijiye...
@RaghavPal
@RaghavPal Жыл бұрын
Brijesh Not sure how soon will I be able to do this. If you like can enable hindi captions from player settings
@user-gl5jj2wu7k
@user-gl5jj2wu7k 11 ай бұрын
Hi Raghav, How can i contact you in other media apart from youtube? Any insta or some other links?
@RaghavPal
@RaghavPal 11 ай бұрын
Pavan if you have any ques, can let me know here, I will reply
@user-gl5jj2wu7k
@user-gl5jj2wu7k 11 ай бұрын
@@RaghavPal I am working on the some APIs. How Can we automate Multiple POST, GET & DELETE APIs on one click? I mean on one click all the APIs should be running based on the data driven. Can you please help me with this?
@RaghavPal
@RaghavPal 11 ай бұрын
To automate multiple POST, GET, and DELETE APIs on one click in Postman, you can use the **Collection Runner**. The Collection Runner allows you to run a collection of requests in sequence. To use the Collection Runner, you first need to create a collection of requests. You can do this by creating a new collection and then adding the requests that you want to automate. Once you have created a collection, you can configure the Collection Runner. To do this, open the Collection Runner and click on the **Settings** tab. In the Settings tab, you can configure the following: * The number of times to run the collection. * The delay between each request. * The order in which to run the requests. * Whether to run the requests in parallel or sequentially. Once you have configured the Collection Runner, you can run it by clicking on the **Run** button. The Collection Runner will then run the requests in the collection in the order that you specified. To automate multiple POST, GET, and DELETE APIs on one click based on data driven, you can use the **Data Driven** feature in Postman. The Data Driven feature allows you to pass dynamic data to the requests in a collection. To use the Data Driven feature, you first need to create a data file. The data file can be a CSV file, a JSON file, or an Excel file. The data file should contain the data that you want to pass to the requests. Once you have created a data file, you can configure the Data Driven feature in the Collection Runner. To do this, open the Collection Runner and click on the **Settings** tab. In the Settings tab, select the **Data Driven** option and then select the data file that you want to use. The Collection Runner will then use the data file to pass dynamic data to the requests in the collection. I hope this helps
@ravireddy7155
@ravireddy7155 2 жыл бұрын
Hi sir i think postman playlist videos completed
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Ravi, just 1 more left, will get it tomorrow
@ravireddy7155
@ravireddy7155 2 жыл бұрын
@@RaghavPal sprrr sir thank you
@ashvinvishal1831
@ashvinvishal1831 2 жыл бұрын
Hi sir,need to contact you from Chennai.
@RaghavPal
@RaghavPal 2 жыл бұрын
Pls tell me Ashvin
@Rajatbhr
@Rajatbhr 2 жыл бұрын
i need ur help for devolpe my tool .. i maild u already but u not responding
@RaghavPal
@RaghavPal 2 жыл бұрын
Pls tell me here
Postman Beginner Tutorial 14 | How to Add Authorization in Postman
11:18
Automation Step by Step
Рет қаралды 164 М.
Postman Beginner Tutorial 9 | Environments
12:15
Automation Step by Step
Рет қаралды 47 М.
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 59 МЛН
Spot The Fake Animal For $10,000
00:40
MrBeast
Рет қаралды 193 МЛН
Как бесплатно замутить iphone 15 pro max
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 8 МЛН
Postman Data Driven Testing with CSV Data File | Postman Testing Tutorial
17:20
SDET Unicorns by Dilpreet Johal
Рет қаралды 10 М.
Learn JavaScript for Postman API testing - Full Course for Beginners
1:28:39
Postman Tutorial #74 - Postman Data Driven Testing using CSV File- Part- 1
13:29
Software Testing Mentor
Рет қаралды 2,7 М.
POSTMAN BEGINNER TUTORIAL 14 💡 How to create and manage WORKSPACES
5:37
Automation Step by Step
Рет қаралды 98 М.
Postman Beginner's Course - API Testing
2:09:38
freeCodeCamp.org
Рет қаралды 2,4 МЛН