Sometimes, you may need to create a load test that lasts for some period of time. This topic describes some approaches that can be used for this purpose:
|LoadComplete supports running load tests for up to 24 hours.|
Using the “Continuous Load” Feature
To run a load test for a certain time, use the Continuous Load.
When the continuous load is enabled, LoadComplete simulates all virtual users in the test until the specified time elapses. If virtual users finish their simulations before the specified time elapses, LoadComplete will repeat the simulation.
Suppose it takes about 2 minutes to run a load test for 15 users and you want to simulate a massive load for 10 minutes. To run the load test for the needed period:
Open the Load Test editor.
Switch to the Continuous Load tabbed page.
Check the Enable check box and set the test duration to 10 minutes.
Run the load test.
LoadComplete will simulate the recorded traffic for 10 minutes. At that, the test will be repeated approximately 5 times. However the simulation will be stopped right after the test time elapses, without waiting for the last test execution to complete.
|Tip:||Note that the overall test duration displayed on the Summary page may be longer than the specified continuous load time. Besides the simulation time, the overall duration also includes the time spent on starting and stopping load tests.|
When using the continuous load feature, LoadComplete restarts virtual users, which have already finished “working”, to achieve the current number of user required by the load test settings. Before restarting a virtual user, LoadComplete can either clear or keep cookies that were saved for the virtual user during the previous “sessions”. This is regulated by LoadComplete’s settings that let you simulate various user activities. See a note in Continuous Load Settings for more information.
Using Combined Load Testing Scenarios
Another way to simulate massive load on the tested web server for a long time is to repeat the same user scenario several times. To do this, you need to create a scenario that will call your recorded scenario several times.
In this case, instead of specifying the load test duration directly, you define the number of test runs. The overall test duration may be approximately calculated as the duration of the scenario multiplied by the number of runs.
To run a load test for 10 minutes, follow the steps below:
Create a scenario that will call your recorded scenario.
Add a Loop operation to the scenario and set the number of iterations to 5.
Add a Call Scenario operation as the child of the Loop operation. Configure the operation to run the needed subscenario.
Create a load test on the basis of the created scenario and assign it to 15 virtual users.
Run the created load test.
There will be exactly 5 iterations, and the test will run for about 10 minutes (2 minutes x 5).
For more information, see Calling Scenarios From Other Scenarios.