In the SoapUI – Getting Started we have seen how to create a functional test.
Now we are going to see how to do load tests for the API’s by reusing your functional tests that you have created.
Once you have created your functional tests, under TestCase tree, you will be having three child nodes.
one is test step where your functional test steps resides. Second is the Load Test node.
Right Cick on the Load Test Node and select “New Load Test”. This will automatically create the Load Tests Steps for you.
If you open the window, You can see some new terms or facts in the window. Lets see these facts one by one.
1. In the LoadTest tool bar buttons, you can see a Limit option by default sets to 60 seconds.
This is nothing but Setting the limit for the LoadTest Execution time.
2. Threads – Sets the number of threads/Virtual users to be used.
3. Strategy – Choose a LoadTest Strategy. Lets see this in detail. By default I will use Simple which means, TestCases will be executed within a configurable Test delay.
4. Test Delay – The time in milliseconds between each batch of requests.
5. Random – The random factor of the Test Load. This means by default the Test delay is 1000 ms and the random factor is 0.5.
So the threads will be distributed randomly between 500ms – 1000ms
6. min-The shortest response time the step has taken (in milliseconds).
7. max-The longest response time the step has taken (in milliseconds).
8. avg-The average response time for the test step (in milliseconds).
9. last-The last response time for the test step (in milliseconds).
10. cnt-The number of times the test step has been executed.
11. tps-The number of transactions per second for the test step.
12. bytes-The number of bytes processed by the test step.
13. bps-The bytes per second processed by the test step.
14. err-The number of assertion errors for the test step.
15. rat-Percentage of requests that failed
When clicking on the Run button, you can see the data/statistics for all the facts mentioned above.
Now we have also done performance tests for our API’s by re-using our existing functional tests.