From the course: Postman Essential Training

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Body assertions

Body assertions

- [Instructor] The next assertion we'll learn about is the body assertion. This assertion verifies that the body of the response contains the text that we were expecting. Let's create an assertion for our get contact request. So we'll open up our collection and our basic endpoint tests folder. We're going to choose the get contact request. Then we're going to go over and select the tests tab and then we'll see those snippets over on the right. We're going to scroll down to find the snippet that says response body contains string, and there it is. So we'll click on that and we can see that our assertion has been added to the tests window. Now this section right here is the title of the test. We're going to change this title to, "Correct contact is returned" and then we're going to change the string that we are expecting from string you want to search to the actual string we want to look for in our assertion. How can we…

Contents