Skip to content
CodeKruPro

Check search results and pagination metadata

Automation taskEasy-Medium

"How would you test a paginated search endpoint?" Explore a real one here first: page sizes, totals and the last page.

Check search results and pagination metadata

02 · Build reusable requests and investigate results

Recommended first: Write a defect report beyond the status code

Your goal: Check search results and pagination metadata

Type each request yourself. This lesson shows the method, URL, headers and body. It does not fill the console.

  1. 1Send requests
  2. 2Submit answers

Start here: sign in to practise.

Jump to practice

What you will learn

A page contains part of a result set. Metadata describes page, page size and total matching records. Correct status and metadata do not guarantee each item matches the filter.

Your goals

  • Compare filtered data with pagination metadata.
  • Record legacy parameter clamping accurately.

Before you start

Read the previous lesson first if you have not already. This course does not require programming.

Practice setup

These requests use the public TestKru teaching API. No workspace is needed unless a step says so. Leave the body empty for GET, HEAD and OPTIONS. Example people and emails are fictional. Changes to /api/users are simulated and are not saved.

Follow these steps

  1. Send the books search with page 1 and limit 2. Select its response and check every item’s category.
  2. Read meta.page, meta.per_page, meta.total and meta.last_page. Distinguish all matching items from the count on this page.
  3. Send page 0 with limit 100 and select its response. Compare the requested values with the effective values returned in metadata.
  4. Record the total and effective page/size, then describe how the API handled the out-of-range values using the provided choices. Submit.

Investigate before concluding

First record the actual result for each case. Compare the body, headers and later state with the stated contract. Keep an observation separate from a prediction; use the model answer only after making your own attempt.

What to keep as evidence

  • Item category and metadata are checked separately.
  • Total is distinguished from current-page length.
  • Clamping is recorded rather than mislabelled as a 400 failure.
References for this lesson

Finish this assignment

Select each named response with Use this response. Answer from those responses or the transcript on this page. Click Submit Answers. Your score is the percentage of checks that passed. Core checks are required to finish. Extra evidence checks are labelled. A saved 100/100 means every check passed. Continue opens the next lesson you can submit.

If something goes wrong
  • Change one part of the request at a time. If a check needs attention, read the note under it and compare it with the response you selected.
Self-review and independent variation
  • Item category and metadata are checked separately.
  • Total is distinguished from current-page length.
  • Clamping is recorded rather than mislabelled as a 400 failure.

Try a query with no matches and compare total 0 with the declared last_page behavior.

Automatic checks verify the requests and answers configured for this lesson. The self-review is for your own reasoning. A score is not a certificate.

Open API reference

Practise and save your evidence

The lesson is public. Sign in to send requests and save progress. You will return to this lesson.

Sign in to practiseCreate an account