Forum Discussion

Awesome's avatar
Awesome
Frequent Contributor
17 years ago

what is the best way to test many (~100) submission of the same requests

i have a request which takes query string (similar to a sql query). so i can query 'fields' (n=100) in a record with the request and the response is the value of the field.

what is the best way to test/assert the responses:

1) using a groovy script, i was thinking to create a request for each field that i can query for, and creating an assertion for the field at the same time. this would create ~ 100 request.
but then if i want to run the test again i would have delete all these request to make sure i'm starting from an "initialized state".

2) the other thought was to loop around one request and pass in a new field value each time, one by one. but how would i verify/grab the results of the assertions?

hope that made sense.

Thanks in advance!
  • Awesome's avatar
    Awesome
    Frequent Contributor
    so i wrote something like:

    fieldList = parse out all fields from wsdl
    for (field in fieldList){
      create request_for_field
      set request values to field
      create assertion for field
    }

    now if i run my test case this groovy script will create a request for each field each with an assertion. after the groovy script finishes each request will run. and i quickly see which request failed, thus identifying which field didn't assert for the response. so far so good.

    the question still remains is this the most efficient way to do this? since this script will be building ~ 100 requests. is it better to try and loop around one request and pass it a field each time (of course this means looping ~ 100 around one request...)
  • Kevin_Mannering's avatar
    Kevin_Mannering
    Occasional Contributor
    Hi Awesome,

    it works quite nicely with a loop...

    right click on your test case and add two steps:

    a Datasource and a datasource loop. You can then put the 100 iterations in an excel file.

    If you want to capture the result in a separate file for each iteration, see my other recent posts.



    Rgds, Kevin
  • Awesome's avatar
    Awesome
    Frequent Contributor
    Thanks for the reply Kevin!!! looking for your other posts now.

    --Love SoapUI!