Prepare and run a Load test

Relevant for: API testing only

This task describes how to prepare a test for load testing in LoadRunner Professional.

Prerequisite

  • Make sure that LoadRunner Professional or a standalone version of VuGen (Virtual User Generator) is installed. Without this installation, the Load Testing template will not be available.

  • If you are running the test from a LoadRunner Enterprise host, ensure that UFT One is installed on the same machine as the LoadRunner Enterprise host.

Back to top

Create a load-enabled API test

In the New/Add New <Document> Dialog Box, in the Select type section, choose API Load Test.

If you have a test that was created with the standard API testing template, select Design > Operation > Enable Test for Load Testing or click the Enable Test for Load Testing button .

Back to top

Add test steps

Drag activities from the Toolbox pane onto the canvas to add steps to the test.

Back to top

Prepare for load testing

To measure the performance of a group of steps, define a transaction.

Purpose Description
Mark the beginning of a transaction
  • From the Toolbox pane, in the Load Testing node, add a Start Transaction activity to the canvas. Place it before the first step of the group of steps that you want to measure.

  • In the Properties, select the Input/Checkpoints tab and enter a Transaction name in the Input section of the tab. This name will be used in LoadRunner Analysis.

Mark the end of a transaction
  • From the Load Testing node, add a End Transaction activity to the end of the group of steps you want to measure.

  • In the Input/Checkpoints tab in the Properties pane, type a transaction name. The name must be one that was already used for a prior Start Transaction step.

  • In the End Transaction's Input properties, select a Status for reporting: PASS, FAIL, AUTO, or STOP.

    The End Transaction status is only the LoadRunner Professional transaction's status—not the status of step in UFT One. For example, if you assign a Failed status to the transaction, UFT One can still issue a Passed status for the test step.

Set the think time
  • If you want to emulate think time, add a Load Testing > Think Time activity between the relevant steps.

  • In the Input/Checkpoints tab, in the Duration (sec) row, specify a think time in seconds.

Back to top

Set the data retrieval properties - optional

If you have data in the Data Pane, set the data retrieval properties. Click the Link to a data source button . For details, see the Data Retrieval Options for Load Test Enabled Tests.

Back to top

Set the run configuration to Release

In the General pane of the API Testing tab in the Options dialog (Tools > Options > API Testing tab > General node), in the Run Sessions options, select Release. The Release mode conserves resources, thus enhancing the load testing capabilities.

Back to top

Run in Load Testing mode to validate the test

Expand the toolbar Run button and select Run Test in Load Testing Mode. This run is only for debugging purposes, to verify that the test is functional.

Note: When you run a test in Load Testing mode, the Output pane does not contain data and the run results do not open. To view the results, select Run to run the test in functional mode.

Back to top

Incorporate the test into LoadRunner Professional

Add the test to the LoadRunner Controller console to include it in a load test.

Back to top

See also: