ProductivityAndFun Download Trial - Free 14 day evaluation

Web Service Sample Project - 4) Web Service Load Tests

PDF Print E-mail
User Rating:  / 140
Rate this article: PoorBest 

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

  1. 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.
    LoadTest Simple Strategy
  2. Let's configure the test.
    LoadTest Simple Strategy View
    1. The first thing to configure in the Simple Strategy is Limit, the Number of second we want the test to run.
    2. The second thing to configure in the Simple Strategy is Threads, the number of threads used. For now we'll use one thread.
    3. 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.
    4. 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.
  3. Now, let's run it!
  4. 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.
    LoadTest Simple Strategy Running
  5. You can also press the graph button
    Choosing Graphs for LoadTests
    and see a graph of the test run.
    LoadTest Graph
    Read more about the Load Test Interface here and the different Load Testing strategies here.
  6. In the soapUI LoadTests, you can also do LoadTest Assertions. One of the more important assertions is the Max Errors Step.
    LoadTest Assertions
    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.

  1. 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).
  2. 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!


Go to Article Page: Go to Previous Page 1 2 3 4 5