How to do API Testing using Python - GET and Validate Json Response
Code:
import requests
import json
import jsonpath
requestURL = "https://reqres.in/api/users/2"
response = requests.get(requestURL)
jsonRes = json.loads(response.text)
val = jsonpath.jsonpath(jsonRes,'data.id')
print(val[0])
headers = response.headers
print(headers)
Chapters:
0:00 - Introduction to the video
0:13 - Import json and jsonpath
0:39 - Program to get json response
4:11 - Validate json response
4:50 - Executing different response methods
Next Steps :
---------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------
Must Watch Playlists
► 1. Javascript - • Javascript Factory
► 2. Puppetter - • Puppeteer
► 3. Cypress - • Cypress
► 4. Tech works - • Video
► 5. Vbscript Basics To Advanced - • VBScript Part 1 - Features Advantage...
► 6. Jmeter - • Jmeter Tutorials
► 7. Excel - • Videos On Excel
► 8. Appium - • Appium
► 9. Shares - • Shares
► 10. Javascript Interview Questions - • Javascript Interview Questions
► 11. C# Tutorials - • C# Factory
► 12. HTML & CSS - • HTML & CSS
► 13. Browser Console - • Browser Console
► 14. JSON - • Videos on Json
► 15. Specflow - • Specflow Tutorials
► 16. MongoDB - • MongoDB Tutorials
► 17. Postman - • Postman
► 18. Python - • Python
► 19. Typescript - • Typescript & Node Imp Questions
► 20. Node - • Node
► 21. Java Selenium Interview Questions: • Java and Selenium Imp
► 22. Real Time Interview Q & A: • Real Time Interview Questions
► 23.SOAP UI Tutorials : • SOAP UI
---------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------
#python
#json
#getrequest
Sur cette page du site, vous pouvez voir la vidéo en ligne How to do API Testing using Python - GET and Validate Json Response durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Azhar Techno Coder 15 mai 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,124 fois et il a aimé 36 téléspectateurs. Bon visionnage!