Awesome
16 years agoFrequent Contributor
how to loop a request and aggregate the responses
hi, here's a tricky question, appreciate any tips in the right direction 
our WS requests uses paging (in terms of how many records are returned.)
so with each request we submit the 'page' and 'page size'.
i'd like to loop a request incrementing the [page] value and aggregate each page of responses. once finished then i would want to run my assertions.
is this even possible?
---example---
**lets say customer record count=1000, and the max page size is 200 (so only 200 records are returned in the response)
1) if i submit a request to return 'all customer records' & page=1, i would receive 200 records in the response.
2) then i would have to submit the request again, page=2, to get the next 200.
3) i would some how loop around the request incrementing the page numbers.
4) aggregating the 200 records returned with each response.
5) now run assertions against the full 1000 aggregated records.
thanks for reading this far

our WS requests uses paging (in terms of how many records are returned.)
so with each request we submit the 'page' and 'page size'.
i'd like to loop a request incrementing the [page] value and aggregate each page of responses. once finished then i would want to run my assertions.
is this even possible?
---example---
**lets say customer record count=1000, and the max page size is 200 (so only 200 records are returned in the response)
1) if i submit a request to return 'all customer records' & page=1, i would receive 200 records in the response.
2) then i would have to submit the request again, page=2, to get the next 200.
3) i would some how loop around the request incrementing the page numbers.
4) aggregating the 200 records returned with each response.
5) now run assertions against the full 1000 aggregated records.
thanks for reading this far
