You can edit scenarios to simulate recorded traffic in the way you need.
Grouping Operations
Adding Groups
You can combine operations in your scenarios into groups by using the Group operation. This way, for example, you will be able to exclude all these operations from the simulation by disabling their parent Group operation.
To group operations:
-
Open your scenario for editing. To do this, right-click the scenario in the Project Explorer panel and then click Edit or double-click the scenario in the Project Explorer.
-
Add the Group operation to the scenario. If needed, set the name for the group.
-
Add all operations to group to the Group operation.
Note: | Combining operations into groups does not affect the way LoadComplete collects test results for the scenario during the test run. |
Grouping Operations by Pages
By default, LoadComplete groups recorded operations by pages, traffic to which they simulate. However, you may want to add custom pages to recorded scenarios.
To learn how to do it, see Adding Custom Pages.
LoadComplete collects various metrics by pages. Grouping operations by pages will affect test results. |
Simulating Traffic in Loop
You use loops to simulate traffic in a scenario repetitively. To do this, you can use the Loop and While operations.
Using the Loop Operation
You use the Loop operation to repeat the operation simulation for the specified number of times:
-
Open your scenario for editing. To do this, right-click the scenario in the Project Explorer panel and then click Edit or double-click the scenario in the Project Explorer.
-
Add the Loop operation to your scenario.
-
For the Loop operation, set the number of iterations.
-
Add operations you want to repeat to the Loop operation.
When you simulate the scenario, LoadComplete will repeat the child operations of the Loop operation for the specified number of times.
Using the While Operation
You use the While operation to repeat operation simulation until the specified condition is broken.
-
Open your scenario for editing. To do this, right-click the scenario in the Project Explorer panel and then click Edit or double-click the scenario in the Project Explorer.
-
Add the While operation to the needed position in your scenario.
-
For the While operation, specify the needed condition to check.
-
Add the operations you want to simulate while the condition is valid to the While operation.
When you simulate the scenario, LoadComplete will repeat the child operations of the While operation until the specified condition is true.
Exiting the Loop
To exit a loop earlier, you can use the Break operation. Typically, this operation is a child of the If... Then or If... Else operation, which, in its turn, resides within the loop body. That is, you exit a loop if certain condition evaluates to true or false:
The Break operation can be used for both loop types: While and Loop.
Checking Conditions
You may need to simulate traffic depending on various conditions, for example, depending on the response returned from the tested web server.
To check a condition in a scenario, use the If operation:
-
Open your scenario for editing. To do this, right-click the scenario in the Project Explorer panel and then click Edit or double-click the scenario in the Project Explorer.
-
Add the If operation to the scenario.
-
Specify the condition to check. The operation can check values extracted from server responses or value generated by LoadComplete or extracted from external sources against the baseline values.
-
Add operations to simulate, if the condition is met, to the Then node of the operation.
Add operations to simulate, if the condition is broken, to the Else node of the operation.
Stopping Scenario Simulation
You may need to stop the scenario simulation directly from the scenario, for example, if the specified condition is met. To do this, you use the Stop operation.
See Also
Editing Scenarios
Operation Reference
Adding, Removing and Arranging Operations in Scenarios
Adding Custom Pages
Enabling and Disabling Operations
Setting Delays Between Operations