Responses can be complex and include arrays and objects. Learn how to access and verify these entities.
- [Instructor] The response we verified in the last section … contained a single object. … However, many times responses are more complex … and can include multiple reason objects. … And sometimes these are even nested. … Let's look into how to verify … complex response bodies like these. … If we make a call to the read product end point … which will return all of the products in our application, … we'll see the body is an object … that contains an array called records. … And inside of this array … we have multiple objects which contain multiple fields. … So how do we verify this? … One thing we may want to ensure … is that the products are actually returned. … There are 19 products here. … So let's do a little bit of verification. … We can start off by first verifying the status code. … So we'll say assert that … and we'll say, we want to assert … that the status code is 200. Okay? … Now, let's get into asserting the body. … But again, … we're not going to assert every single thing in this body …
Skill Level Intermediate
API setup3m 46s
1. Getting Started with REST Assured
REST Assured testing library3m 29s
2. Making API Requests
3. Validating API Responses
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.