Back to Browse

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

1.4K views
May 16, 2023
6:01

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 - https://youtube.com/playlist?list=PLO2l2fYgN805CokP5kaOWOhqP3-2vyXdS ► 2. Puppetter - https://youtube.com/playlist?list=PLO2l2fYgN805E5fbSnvtFM3K9c92ePS8e ► 3. Cypress - https://youtube.com/playlist?list=PLO2l2fYgN807KRpLfvvrqa1MSX8XdYxkV ► 4. Tech works - https://www.youtube.com/watch?v=ZNAdt4Oe5Sw&list=PLO2l2fYgN807CQ5H3ER__7x7LeEA10T2Z ► 5. Vbscript Basics To Advanced - https://www.youtube.com/watch?v=z_ctZDolyG0&list=PLO2l2fYgN805CuD-90ESrxRqX__-YJMym ► 6. Jmeter - https://youtube.com/playlist?list=PLO2l2fYgN806eNr5cr-TMTX8xGTW7Mtcn ► 7. Excel - https://youtube.com/playlist?list=PLO2l2fYgN806piZ2fD0bYNi3ExoPJlcqj ► 8. Appium - https://www.youtube.com/playlist?list=PLO2l2fYgN806V_9-wL-dpmrGg8dhPPONK ► 9. Shares - https://youtube.com/playlist?list=PLO2l2fYgN806ySmKp3sskJW0ByJalmPE2 ► 10. Javascript Interview Questions -https://youtube.com/playlist?list=PLO2l2fYgN807uZl7Mp7ESavluzVU25ux9 ► 11. C# Tutorials - https://www.youtube.com/playlist?list=PLO2l2fYgN805Dct9KbYNYC8nGOzwKjklt ► 12. HTML & CSS - https://www.youtube.com/playlist?list=PLO2l2fYgN804tkFuKw9DlcVXT0m8hDzdw ► 13. Browser Console - https://www.youtube.com/playlist?list=PLO2l2fYgN80692hfTP1BcgmWNBZV0ZYzo ► 14. JSON - https://www.youtube.com/playlist?list=PLO2l2fYgN8062RQNrQt5xAQZFaFINvMsY ► 15. Specflow - https://www.youtube.com/playlist?list=PLO2l2fYgN806s2KXmhI6eqHLwP_sriPl0 ► 16. MongoDB - https://www.youtube.com/playlist?list=PLO2l2fYgN80626nl1UkUz3ufXSlgMXIkh ► 17. Postman - https://youtube.com/playlist?list=PLO2l2fYgN804Nf9Vfma54yFNwlA3bF9-Z ► 18. Python - https://youtube.com/playlist?list=PLO2l2fYgN80486BcimGYi9Y3XQ-beQHCN ► 19. Typescript - https://www.youtube.com/playlist?list=PLO2l2fYgN805MyyI2Q1YpkX78OehOqzDg ► 20. Node - https://www.youtube.com/playlist?list=PLO2l2fYgN807v_icJITbdYV_IP5wdgDIy ► 21. Java Selenium Interview Questions: https://www.youtube.com/playlist?list=PLO2l2fYgN806mr2M9Km0KNQz_wv_tZTwD ► 22. Real Time Interview Q & A: https://www.youtube.com/playlist?list=PLO2l2fYgN805uI-sDXvo0jV6qvXWHi6x8 ► 23.SOAP UI Tutorials :https://www.youtube.com/playlist?list=PLO2l2fYgN807YvgfwfRCVM9e0mepllR-n --------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------- #python #json #getrequest

Download

1 formats

Video Formats

360pmp47.8 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

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