Session 4: API Testing | RestAssured | Parsing Response Body | JSONObject

preview_player
Показать описание
#apitesting #restassured#jsonobject

@02:02 Running local API
@02:41 checking api by URL
@03:27 Create package, class and test method
@5:54 Import static packages

VALIDATING JSON RESPONSE USING MATCHERS
@06:50 Declaring input type in Given() (correction @50:42)
@07:21 Declaring URL in GET request in When()
@8:00 Validate status code and Header in Then()
@09:02 Gather JSON response in POSTMAN for same URL
@12:00 JSON pathfinder to find path of specific field
@12:51 Using the path, validate a specific field of JSON response in Then()
@14:17 Execution of the code

VALIDATING JSON RESPONSE USING ASSERTIONS (Without using `Then()`)
@16:59 Declaring input type in Given()
@17:54 Declaring URL in GET request in When()
@18:14 Storing response into variable
@19:32 Validating status code using assertions.
@21:31 Gather Header in POSTMAN for same URL and Validating Header using assertions.
@23:01 Validating specific field of JSON response in Then() using assertions
@26:43 Execution of the code

@33:10 Converting JSON response into JSONObject
@34:33 Gather all values from specific JSON field for same URL in POSTMAN
@36:05 Using for loop to print all values from specific JSON field
@52:54 Execution of the code
@53:26 Drawbacks of this method.
@54:53 Using for loop and assertions to validate value from specific JSON field
@58:58 Execution of the code

@01:01:38 Printing the total of specific values from JSON field.
@01:05:10 Execution of the code
@01:05:31 Using assertions to validate total of specific values from JSON field.
@01:06:04 Execution of the code

=====================================
Udemy Courses:
=====================================

Manual Testing+Agile with Jira Tool
*************************************

Selenium with Java+Cucumber
********************************

Selenium with Python & PyTest
********************************

Selenium with python using Robot framework
***********************************************

API Testing(Postman, RestAssured & SoapUI)
*********************

Web & API Automation using Cypress with Javascript
*******************

Playwright with Javascript
******************

Jmeter-Performance Testing
*******************

SDET Essencials(Full Stack QA)
********************

Appium-Mobile Automation Testing
***********

Java Collections
*******

Python Programming
******

Cucumber BDD Framework
*****

Protractor with Javascript
******

================================
Youtube Playlists:
================================

Manual Testing & Agile
*****

SQL
****

linux & Shell Scripting
*****

Java
*****

Selenium With Java+Cucumber
********

Python
*******

Selenium With Python,Pytest&Behave
*************

Selenium With Python Using Robert Framework
(Web&API Testing)
**************

API Testing (Postman,SoapUi,&Rest Assured)
**************

Mobile App Testing Appium
************

Performance Testing Jmeter
************

Maven,Jenkins,Git,Github,CI/CD
***********

SQL,DB Testing&ETL,Bigdata
**********

JavaScript Based Automation Tools
************

Selector Hub Tools
*******

GraphQL
********

Cypress API Testing
***********

Cypress Web Testing
***********

Playwright with Javascipt
**********
Рекомендации по теме
Комментарии
Автор

I dont know how to thank you. You are the best teacher and you make things simple.

gurudattv
Автор

Really sir, It is a very nice session regarding parsing.Everything is cleared regarding parsing after attending this session sir.Thanks alot sir 😊

PrinceMaini-bdyr
Автор

Issue: A JSONObject text must begin with '{' at 1 [character 2 line 1].
Solution: // Parse the response into a JSONArray
JSONArray jsonArray = new JSONArray(res.asString());

// Iterate through the array of objects
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject bookObject = jsonArray.getJSONObject(i);
String bookTitle =


// Add assertions if needed
// For example: assertEquals(bookTitle, "Expected Title");
}

rishikeshshah
Автор

Thank your for your great tutorial. I follow mostly your tutorial while learning Test Automation topics. I had problem in validating the title of last book. I solved it this way. I am posting this solution, because it may help some one who is facing same issue. I was getting Nullpointer exception with this line of code String bookname =
Solution
String bookname =
Assert.assertEquals(bookname, "The Lord of the Rings");

rishikeshshah
Автор

Hi sir, I have a question for you, which automation tool can I use for developing an automation framework for Microsoft Dynamics SL. It does not have a URL. It is remote access.

olaojeyinka
Автор

Thank you, Sir you are an amazing teacher. I have learned a lot from you. One of your scenarios could be simplified, you don't need to use the loop.

.then()
.body("book.title", hasItems("The Load of the Rings"));

eidblkd
Автор

Thank you for lessons Mr. Pavan, but when documents are not shared it is very hard for us to practice.I have spent 10 minutes reading comments so see, if anybody shared the doc or not:(

AmerikadakiAileniz
Автор

Hi Sir..Thanks for sharing this knowledge..Sir, If we want to practice we don't have documents.
please attach documents sir..then only we can easily practice what you teach.

Ram_
Автор

in 50:10 and in 53:40 store.json file got changed as Price values are different
Nice transition sir

VarunG-kqmf
Автор

Your videos are great. Do you have any tutorial for cucumber with Serenity?

faribarezaei
Автор

Sir, the error @47.34 timestamp is because of sending the response as toString() (which converts an object into string). But the response body we got is not an object, hence we need to use asString() method which converts response into string.

snehadhande
Автор

Not able to pass res.asString() in JSONObject, as it's asking value in the form of map .

lovishsethi
Автор

The json files you are using as example, where its shared?

matinshaikh
Автор

Sir when I passed json response as string to create JSONObject, the compiler is showing error that constructor does not exist

bjmhnmn
Автор

Hi @sdetpavan Sir, first up all thanks for your efforts, whenever I was stuck in my QA journey I followed your videos and it solved my problem recently I started working on API testing and I wondered if we don't have an array in our JSON and we have to find username in the body like you find the all titles in array how we will get those username with Response?

gaganvaidya
Автор

Hi sir, great job! Thank you for your efforts. Just one thing: the price of the books at the end of the video is incorrect sir

adelajdagega
Автор

Sir can you please share the document
If I need to rum my lab is there any prerequisite is please help me I am strucking sir

bbkrishnareddy
Автор

After hitting json-server URL on browser i didn't get any data in it why? only i get { }

madhavkharge
Автор

Hi sir, getting null values when try to validate the value from json response

nugrcgb
Автор

hi sir..good evening...sir i want take testing course from you through online...can you tell me course details and fee..how can I contact you sir ?please give reply sir

ummadisindhuja