This example shows a simple offset based pagination setup.

Prepare a Data Source

Depending on the pagination type you want to use you need at least 1 variable exposed by the data source you want to paginate over. In this example we use offset-based and expose the offset variable.

The data source will return the following example json

{
  "total": 100,
  "result": [
    {
      "id": 1,
      "title": "title for 1"
    },
    {
      "id": 2,
      "title": "title for 2"
    }
  ]
}
CODE

Setting up the Paginated Data Source

Creating a new data source and using the type Paginated Data Source will let you select the data source you want to paginate over followed by the pagination type. In this case we use Offset-based and select the offset variable created earlier in the Offset Variable selection.

Based on the Json result the Result Selector will point to the list containing the items we care about.

$.result[*]
CODE

The Finish Condition in this case is managed by the total value that gets returned by each page. As well we use a JsonPath to select the Finish Target

$.total
CODE

See the following screenshot of the complete setup: