Using SoapUI for Load Testing

In SoapUI, you create load tests on the base of existing functional tests. This helps you quickly and easily create performance tests for your web service. You can then validate the web service performance using different load strategies, check that its functionality does not break under load, run several load tests simultaneously to see how they affect each other, and much more.

You can also take your performance testing to the next level by using the next generation LoadUI Pro (part the ReadyAPI application suite). With this tool you can simulate the load from local and cloud machines, monitor your server and database resources, create performance tests quickly from pre-configured templates, and automate your tests with a few clicks.

Let's move on to the tutorial. What we are going to learn is the following:

  1. Create a new LoadTest
  2. Run the LoadTest
  3. Add Assertions to the LoadTest
  4. Run your LoadTest in LoadUI Pro

1. Create a new LoadTest

  1. In the Navigator panel, right-click your TestCase and select New LoadTest from the context menu:
    Create new LoadtTest in SoapUI
  2. In the subsequent dialog, enter the test name and click OK:
    New_LoadTest_Dialog

The LoadTest editor will open. Let's now configure and run the created test.

2. Run the LoadTest

When a new LoadTest is created, it is pre-configured to run for 60 seconds with 5 threads using the Simple load strategy (see the image below).

  1. Modify the test properties (read more about this).
    Simple LoadTest Strategy in SoapUI
  2. Click Run on the editor toolbar to start the test.

    SoapUI will track the execute, collect statistics and update the table that you see in the editor (read more on test execution).

    In 60 seconds, the test will finish and you will see the results:

    Finished LoadTest In SoapUI

We have now succesfully run our first LoadTest. Let's now add an assertion to validate the results.

3. Add an assertion to the LoadTest

  1. In the LoadTest editor, switch to the LoadTest Assertion tab:
    LoatTest Assertion Tab
  2. Click plus-btn.png Add Assertion button in the LoadTest Assertion menu bar to add a new assertion:
    Add assertion button in Load Test Editor
  3. In the subsequent dialog, select the assertion type to add. Let's choose Step Maximum. This assertion sets the maximum allowed response time. If some request is executed longer, the test will fail. This is a good way to establish and check some SLA for your web service. Click OK:
    Add LoadTest assertion dialog
  4. SoapUI will display the dialog box, where you can specify the assertion properties. Enter the maximum response time in the Max Time edit box. By default, it has 1000 milliseconds (that is, 1 second). Let's keep the default value and click OK:
    TestStep Max Assertion
  5. The Step Maximum assertion is now added to the test:
    TestStep Max inserted
  6. Now run the test again. If some responces will work longer than 1 second, you will see numbers in the err column. This indicates that your test fails.

    LoadTest with errors

4. Run your LoadTest in LoadUI Pro

You can open the test project you created in ReadyAPI LoadUI Pro. The latter will import your project and all tests in it automatically. You can then use all the Pro features like distributed and cloud testing, server monitors, specific load testing assertions, and more. If you have not seen LoadUI Pro yet, download it from our website for free.

In this article

  • 1. Create a new LoadTest
  • 2. Run the LoadTest
  • 3. Add an assertion to the LoadTest
  • 4. Run your LoadTest in LoadUI Pro

LoadUI NG Pro