Calling Scenarios From Other Scenarios

Applies to LoadComplete 4.97, last modified on May 20, 2019

Why Calling Scenarios From Each Other

You can run one user scenario from another scenario. This feature lets you present a scenario that corresponds to a large user session as a sequence of smaller scenarios, and manage them conveniently.

Imagine a typical user session in an online shop. It consists of several steps like logging in, browsing pages, editing data, making an order, and logging out. Instead of recording one scenario that covers all these actions, you can record smaller scenarios (subscenarios) for each step and then call them from some high-level scenario in the appropriate order. This approach simplifies scenario management:

  • If, for example, developers change the login procedure, you can re-record only the “login” subscenario rather than update the entire high-level scenario.

  • You can easily change the behavior simulated by virtual users by adding new subscenarios or deleting or disabling existing ones.

  • You can have one “login” and one “logout” subscenarios and easily run what is between them in a loop.

  • And so on.

How It Works

1. Record subscenarios

Record scenarios that correspond to user session steps. The easiest way to do this is –

  1. Start the recording in a usual way. Open the page in a browser and work with the page as a user would do this.

  2. Stop the recording when a certain step is over, for instance, after you logged in to the tested web site and before you started navigating to other pages.

    Important: Do not close the browser.

  3. Start the recording in the same session in your browser, from the page where you stopped it.

    Stop it after the next step is over. Do not close the browser.

  4. Repeat steps 1 and 2 until you record all the needed subscenarios.

For information on recording, see Recording User Scenarios.

2. Calling subscenarios

  1. Open the scenario, from which you will call the recorded subscenarios, for editing.

  2. Drag the desired subscenario from the Project Explorer panel to the needed place in your scenario. LoadComplete will add and configure the Call Scenario operation automatically.

    – or –

    Add the Call Scenario operation to the needed place in this scenario and configure it to run this or that subscenario.

    To call a subscenario from a scenario several times, you can use the Loop operation and add subscenarios as child operations to this loop. See Controlling Traffic Flow:

    Calling scenarios from other scenarios

    Click the image to enlarge it.

  3. Repeat the procedure for any other subscenarios you want to add to your scenario.

After you have created a scenario that calls other scenarios, you can assign it to virtual users in your load test.

Important Notes

  • A scenario that calls other scenarios cannot include Page operations and their child operations (Connection, Request, or others). Move these operations to a separate scenario and call it from your scenario.

    Note: The Page operations may be hidden. To make them visible, click the Pages item of the Scenario Explorer toolbar:
    The Pages toolbar item
  • Variables you define in a subscenario will be available from the scenario that calls that subscenario and from other subscenarios that the main scenario calls.

    If several subscenarios define a variable with the same name, LoadComplete will use the latest defined variable.

  • LoadComplete cannot correlate dynamic parameters in scenarios that call other scenarios.

    That is, if your “main” scenario calls several subscenarios that use the same dynamic parameters, LoadComplete will not be able to correlate those parameters between subscenarios. To make sure that a value received from a server in a subscenario is used properly in subsequent subscenarios, you will have to correlate it manually.

  • If a scenario calls other subscenarios, then its expected response codes and data replacers are ignored. Use a subscenario's expected response codes and data replacers instead.

Viewing Results

In the test log, LoadComplete combines data collected for the subscenarios that were called from the main scenario.

Load testing with LoadComplete: Combined Log

Click the image to enlarge it.

In the General Information report on the Report > Summary page, you can see completion time for each subscenario and the main scenario. The Total tab contains results for the “parent” scenario:

Load testing with LoadComplete: Subscenario results in the Summary report

Click the image to enlarge it.

Note: Comparison reports show data only on the combined completion time of the main scenario. They do not compare the completion time of individual subscenarios.

See Also

Editing Scenarios
About Scenario Recording
Loop Operation
Call Scenario Operation

Highlight search results