4. Complex Load Scenario
Intro
Last TestCase we looked at the components of the Scheduler type, there is another very useful type of component; the Flow Component. If the Schedulers control how the test is related to time, the flow components control how the project flows, hence the name.
If you think of the test data flowing from the components in the connector lines, the flow components are able to control which direction the data flows and even stop the flow.
Let’s look at the flow components and see how they can be used.
Preparations
As before: make sure you are in Local Mode in the System toolbar at the bottom of this window, and then run the LoadTest by pressing the Run button on the top left toolbar.
The Limit
This TestCase will run for 10 minutes or for a 1000 requests. LoadUI will stop whenever of these two conditions is met.
The Setup
Let’s look at the how the final TestCase in the sample project is set up.
- The Generator
We are using a fixed rate generator to create a steady base load in the TestCase. Running at 96 requests per second, the generator will create a decent load. - The Splitter
Central to the TestCase is the splitter. The splitter will split up the load according to the Type we’ve set. For this test we’ve chosen round robin which passes messages on in a steady round robin order.
We also have the random type which splits the requests randomly. You can adjust the number of outputs you have simply by moving the Number of Outputs slider. - The Runners
The first execution path running from the splitter goes to three Web Page Runners going to different web pages (http://localhost:8081/index.html, http://localhost:8081/userguide/index.html, and http://localhost:8081/search.html). Between the second and third Web Page Runner we will add a Delay Component.
A delay component is a component that delays sending the message on in the flow. The messages can be set to run with a certain amount randomness as well. The purpose of the delay component is to add a certain amount of unpredictability, making the test more lifelike. The output from the third component will also be shown in a graph component.
The second execution path is pretty similar although using a a soapUI Runner, but a bit more simple except for one small connection. This connection comes from the output of soapUI Runner in the third path. This means that the number of requests from the second runner actually is double.
Note:
- A Delay Component can be used to create more lifelike behavior in the tests.
- The Splitter Component can be used to create parallel execution paths, adding a new path is done by using the slider in the component.
Conclusion
That's it! You've now seen how tests can be created in loadUI, you've seen that loadUI supports creating the most simple quick test possible to the most sophisticated user behavior test possible.
Now, go forth and test! Use your imagination! Find those bottlenecks!





