4) Web Service Load Tests
Introduction
Something very useful in soapUI is the ability to quickly create LoadTests. Why is this useful? The earlier you are able to run load tests, the earlier you can discover any performance issues. In soapUI you create a LoadTest simply by choosing a functional test, right-clicking it and saying New LoadTest. Done!
This makes soapUI LoadTest extra good since the immediately enable you to load test the functionality not that the Web Service can respond quickly to the same Request over and over again. LoadTests are byproducts of the Functional Tests.
Tutorial
- Go to the TestSuite Sample expanded TestSuite and the TestCase Search and Buy TestCase. There are four different LoadTests in that TestCase, one for each LoadTest strategy. For now, we'll choose the LoadTest: Simple Strategy LoadTest. This LoadTest is based on a Load Strategy we call Simple Strategy which is a very basic strategy with a random delay.

- Let's configure the test.

- The first thing to configure in the Simple Strategy is Limit, the Number of second we want the test to run.
- The second thing to configure in the Simple Strategy is Threads, the number of threads used. For now we'll use one thread.
- The third thing to configure is the Test Delay, which sets the number of milliseconds our base delay will be (1000 is one second). In the test now we have set it to 200 milliseconds.
- The fourth item is the Random variable, which sets how the Test Delay should be changed at random, the value 0.5 means it should be half, that is between 100 and 300 milliseconds.
What would the value 0 in Random mean? That's right, no random delay at all, just 200 milliseconds all the time.
- Now, let's run it!
- As you see the numbers of the test are continuously updated. You can see figures like the response times' throughput per second (tps), assertions, errors, percent of the test run, and more.

- You can also press the graph button

and see a graph of the test run.
Read more about the Load Test Interface here and the different Load Testing strategies here. - In the soapUI LoadTests, you can also do LoadTest Assertions. One of the more important assertions is the Max Errors Step.

This is used for allowing the maximum number of errors allowed in a test run, which will lead us to the final example, discovering an error in our MockService.
An error in our MockService
Finally we would like to look at one error we've put in the MockService on purpose.
- Go to the TestSuite Sample TestSuite fails if we don't get faults and the TestCase TestCase: Searching after Logging out LoadTests. There you will find a load test called LoadTest with Multiple Tests (will fail).
- Open it and run it. After a time this test will fail
Why?
Because multiple users are simultaneously logging in with the same username, which is not allowed by the MockService
Go ahead, try it!




