Forum Discussion

Awesome's avatar
Awesome
Frequent Contributor
15 years ago

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

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    Unfortunately assertions can only be run on requests/responses currently.
    What you could do is
    - use property expansion to track page count
    - use conditional gotos (http://www.soapui.org/userguide/functio ... ostep.html) for looping
    - use a datasink to aggregate the responses
    - use a groovy script to do the assertions
    I hope this helps. If further help needed please let us know.

    Regards

    /Dragica
    eviware.com