How to do API Testing using Python - GET and Validate Json Response

Veröffentlicht am: 15 Mai 2023
auf dem Kanal: Azhar Techno Coder
1,124
36

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


Auf dieser Seite können Sie das Online-Video How to do API Testing using Python - GET and Validate Json Response mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Azhar Techno Coder 15 Mai 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,124 Mal angesehen und es wurde von 36 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!