AllRounder.ai
Chapters in this course

Enrol to start learning

Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.

Enrol free

11.4. Writing Basic Assertions in Postman (Test Tab)

  • This section

    Practice test

    10 questions on this section. Wrong answers show you what to read again.

    Sign up to take it
  • Whole chapter

    Revision test

    Mixed questions from across the chapter. Your answers get marked.

    Sign up to take it
  • Quick

    Flashcard drill

    2 cards from this lesson. Good the night before a test.

Try these first

  1. 1.

    What function do you use to check if the status code is 200 in Postman?

    Hint

    The function is used to check HTTP response codes.

  2. 2.

    What data format is typically checked in API responses?

    Hint

    Think about what data structure uses key-value pairs.

  3. 3.

    What is the purpose of assertions in Postman?

    • To check if the API exists
    • To verify API responses
    • To send requests
    Hint

    Consider why testing is done in APIs.

  4. 4.

    True or False: You cannot use JavaScript code in the Tests tab of Postman.

    • True
    • False
    Hint

    Remember the programming you can do in Postman.

  5. 5.

    You are creating an API test to validate different responses based on user roles. Write two assertions for user roles - 'admin' and 'user'.

    Hint

    Focus on how admin responses differ from user responses in your tests.

  6. 6.

    A segment of your response should return an object with nested fields. Write an assertion to check for a nested field.

    Hint

    Remember how to access complex JSON structures.

Exercises

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting

4 more questions available

Enrol free

Quiz

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting

Get your answers marked and your progress tracked

Enrol free

Challenge Problems

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting