Run scripts from your IDE on other LR products

LoadRunner Developer provides the ability to scale up your load tests using LoadRunner Cloud (LRC) or LoadRunner Enterprise (LRE), without leaving your IDE.

Version support: Support for this functionality:

  • Run on LRC: Supported for LoadRunner Developer 2020 SP1 and later.
  • Run on LRE: Supported for LoadRunner Developer 2020 SP3.

Tip: Check out the video: Integration with LoadRunner Cloud.

About scaling your test from your IDE

To scale up your load tests, you can execute your DevWeb scripts on LRC or LRE, directly from your IDE.

You do this using the LoadRunner Developer CLI tool, ScaLRD. You configure the relevant .yml file for the tests with the number of Vusers to run, and other values for the script run. In your IDE, you define a task to run the tool for a specified script.

You can use this capability with any IDE.

Prerequisites

The following are required to execute the tests:

  • A LoadRunner Cloud or LoadRunner Enterprise license, as relevant.
  • ScaLRD, the CLI tool for running the tests. ScaLRD is included in the LoadRunner Developer deployment package, starting from version 2020 SP2.

Back to top

Configure the YAML file

You configure the appropriate configuration file, according to where you want to run your test:

  • To run on LRC, configure lrc_uploader.yml
  • To run on LRE, configure lre_uploader.yml

The YAML files contain customizable default values for the script run, with explanations for each parameter. These settings include:

  • tenant or environment settings: These are required values for communication with the LRC or LRE machine. These settings can be defined in the YAML file, or in the command line flags (see Run ScaLRD from your IDE).

    Note:  

    • The Password key can be deleted from the file, and instead entered during runtime.

    • We recommend that you do not add sensitive information like passwords in plain text—see Mask and encrypt data.
  • sendEmail: For LRC only. When set to true, the results report for the script run will be emailed at the end of the run to the login user. To email to additional recipients, enter one or more email addresses for the emailAddresses property.
  • Scenario and general settings: For example, the number of Vusers to run, ramp up time, duration, and logging.

Mask and encrypt data

2020 SP3 update: Masking and encrypting is supported from version 2020 SP3.

If the lrc_uploader.yml/lre.uploader.yml file for your script includes a password or other sensitive data, you can mask or encrypt the information in the file.

Mask or encrypt the relevant text as described in Encode sensitive data, then add the encoded strings to the YAML file using one of the following syntaxes:

  • To unmask a masked value: Unmask(<masked_data>)
  • To decrypt an encrypted value: Decrypt(<encrypted_data>)

For encrypted data, define the key location for decryption during replay. In the encryption area, define the property keyLocation using the format: "folder/keyFile.txt".

Local configuration

The settings in the master lrc_uploader.yml or lre.uploader.yml configuration file (located in the same directory as the ScaLRD executable) apply for all scripts that you execute on LRC or LRE, as relevant.

You can also copy the appropriate uploader configuration file to a specific script directory, and customize the file settings for use with that specific script. During the script run, the settings in the local configuration YAML file will override the settings in the original (master) file.

Back to top

Run ScaLRD from your IDE

To scale your load tests in LRC or LRE, you can define a task to run ScaLRD from any IDE. Once the task is running, if you close it locally in your IDE, the test will continue to run on LRC or LRE.

For tests on LRC, you can later return to the test from your IDE to see its progress, or to get the results after execution is complete. For details, see Return to the test and see results.

Note:  

  • ScaLRD supports LDAP authentication when connecting to LRE; single sign-on (SSO) is not supported.
  • ScaLRD will use the system environment variable for http_proxy, https_proxy, or no_proxy, if defined.

To run tests with any IDE:

  1. Create your DevWeb script, and test it in LoadRunner Developer.
  2. Configure the required settings in the lrc_uploader.yml or lre_uploader.yml file, as appropriate.
  3. Open the script in your IDE.
  4. Set up a task for ScaLRD to run the test.

    When setting up the task in your IDE, you configure the arguments and flags for the command line using the following format.

    LoadRunner Developer 2020 SP3:

    Windows: LRC %DEVWEB_PATH%\ScaLRD.exe lrc run <flags> <DevWeb script folder path>
    LRE %DEVWEB_PATH%\ScaLRD.exe lre run <flags> <DevWeb script folder path>
    Linux or macOS: LRC $DEVWEB_PATH/ScaLRD lrc run <flags> <DevWeb script folder path>
    LRE $DEVWEB_PATH/ScaLRD lre run <flags> <DevWeb script folder path>

    LoadRunner Developer 2020 SP1-SP2 (LRC only):

    Windows: %DEVWEB_PATH%\ScaLRD.exe <flags> <DevWeb script folder path>
    Linux or macOS: $DEVWEB_PATH/ScaLRD <flags> <DevWeb script folder path>

    All flags (except the report) can be configured in the lrc_uploader.yml or lre_uploader.yml file. If you add them in the command line, the flag definitions will override the YAML file definitions.

    For example, you might add to the command line -report=<report location> -user=KimW

    Note: We recommend that you do not add sensitive information like passwords in plain text—see Mask and encrypt data.

    LRC flags:

    -host= The LRC host name.
    -user= The user name to use to log into LRC.
    -password= The password to use to log into LRC.
    -tenantId= The tenant ID of the user.
    -projectId= The ID of the project on which the tests will run.
    -report= The relative or root path to the location for the results report. If a path is not specified, then it is saved by default to the script folder.

    LRE flags:

    -host= The LRE host name.
    -user= The user name to use to log into LRE.
    -password= The password to use to log into LRE.
    -tenantId= The tenant ID of the user (if required for the environment).
    -domain= LRE only: The domain name of the user.
    -project= The LRE project name.
    -report= The relative or root path to the location for the results report. If a path is not specified, then the report is not generated.
  5. Run the ScaLRD task.

    • LRE test: The DevWeb script folder is uploaded to the default test set plan folder in LRE for the LoadRunner Developer integration, AutoTestPlan. (If AutoTestPlan does not yet exist, it is automatically created the first time you run a test using ScaLRD.)

      A performance test is created for the test in the same test set plan folder, using the label <Script Name>_PerformanceTest.

    • LRC test: If this is the first run for the test using ScaLRD, the DevWeb script folder is uploaded to LRC, and the test is given the label Autogenerated_<script name>.

      If a test with the same name already exists in LRC, the script is updated, and the test is used for the test run.

      If relevant, the email addresses for the result report are added in LRC.

  6. The test is executed, using the configuration settings in the relevant uploader configuration file.

    • LRE test: When the test is run, the test instance is assigned to the AutoTestSet under the AutoTestSetFolder (if these do not exist, then they are automatically added). The test run is given an ID number, for example, Test Id 184.
    • LRC test: When the test is run, any SLA attached to the test is disabled. (The SLA is disabled for the test, not just for the current run.) The test run is given an ID number, for example, #184.

    The ID can be used together with the test name to identify the run in LRC or LRE.

    You can watch the run progress from the LRC or LRE UI. For details, see the LoadRunner Cloud Help Center or the LoadRunner Enterprise Help Center.

Return to the test and see results

2020 SP3 update: This process, using the continue command, is supported for LRC from version 2020 SP3.

  1. Set up a task in your IDE to continue monitoring the test on LRC. You can reference the test using either the script location or the test ID in LRC.

    Configure the arguments for the command line using the following format:

    Windows: LRC %DEVWEB_PATH%\ScaLRD.exe lrc continue <DevWeb script folder path OR test ID in LRC>
    Linux or macOS: LRC $DEVWEB_PATH/ScaLRD lrc continue <flags> <DevWeb script folder path OR test ID in LRC>
  2. Run the task. The progress pane indicates if the test is still running, or if it has finished.
  3. When the test run is completed, you can view the summary report.

Back to top

Example: Run from Visual Studio Code

The following example describes how to set up and run a task to scale your tests from Visual Studio Code.

Tip: A predefined tasks.json template for VS Code is provided for use with ScaLRD. The template is based on running a test on LRC, and is available here: \<DevWeb root folder>\examples\VsCodeTemplate

To set up a task for ScaLRD in VS Code:

  1. Create your DevWeb script, and test it in LoadRunner Developer.
  2. Open the script in VS Code.
  3. Either open an existing tasks.json file, or add a new task.

    To add a new task:

    1. Select Terminal > Configure Tasks (in older versions of VS Code, select Tasks > Configure Tasks).  
    2. Select Create tasks.json file from template from the task list.
    3. In the Select a Task Template list, select Others. VS Code creates a tasks.json file as a basic template.
  4. Add the relevant content to the tasks.json file, as follows:

    Property name Value
    task Define your own label to identify the task.
    type Define as shell.
    panel Define as new. Every run will be in a new panel.
    <Platform> You can run the task on Windows, Mac, or Linux OS (windows, osx, linux).
    command Define the path to the ScaLRD executable file, for the specified platform.
    args Add the path to the relevant script folder, and the flags you want to include (the flag definitions will override the settings in the lrc_uploader.yml or lre_uploader.yml file). For details, see Run ScaLRD from your IDE.

    Example:

  5. Save the file.

To run the test:

  1. In VS Code, select Terminal > Run Task.
  2. In the Select the task to run list, select your task (the label you defined previously).
  3. In the displayed list of options, select Continue without scanning the task output. The task starts running, and the script is uploaded to LRC or LRE. Progress is displayed in the Terminal pane.

  4. A brief replay summary is displayed, providing information on the run and a transaction summary. It also provides the path to the report PDF, containing the full details and graphs for the test run.

    Example:

Back to top

FAQ

Is a load test run from the LoadRunner Developer integration the same as a test run from the LRC or LRE UI?

Yes—a test run using the LoadRunner Developer integration is run like any other LRC or LRE test.

How is my load test created in LRC or LRE, the first time I run the test?

When you execute your test from the LoadRunner Developer integration:

  • In LRC: The script is uploaded to LRC, and a load test is created using the label Autogenerated_<scriptname>.
  • In LRE: The script is uploaded to the AutoTestPlan folder, and a performance test is created using the label <Script Name>_PerformanceTest.

Note: If you make configuration changes to the test in the LRC or LRE UI, when you execute the test again from the LoadRunner Developer integration, some of your configuration items might be overwritten.

How can I add additional assets to my LRC load test?

Whenever you execute a test on LRC from the LoadRunner Developer integration, only the script asset that is uploaded is used for the test. You cannot run multiple assets.

How can I change distribution for an LRC load test?

You can configure distribution locations for the test in the LRC UI. When you run the test again from the LoadRunner Developer integration, it uses the latest configuration in the LRC UI.

How can I define monitors for my load test?

You can set up monitors for the test in the LRC or LRE UI. When you run the test again from the LoadRunner Developer integration, it uses the latest configuration in the LRC or LRE UI.

How can I change general settings for the load test?

You can change some general settings using the LRC or LRE UI.

In LRC, the email report address will be overwritten whenever the test is executed from the LoadRunner Developer integration.

How can I edit the SLA setting for the load test?

When you execute the test from the LoadRunner Developer integration, the SLA for the test transactions in LRC is disabled. You can enable it again if you run the test from the LRC UI.

In LRE, you can define an SLA for the test, and the SLA settings are not affected by further runs of the test from LRD.

How can I change the script schedule settings?

You can change schedule settings, for example for number of Vusers, duration, and so forth, in the scenario section of the lrc_uploader.yml or lre_uploader.yml configuration file.

When you execute the test from the LoadRunner Developer integration, these settings will overwrite the settings in the LRC or LRE UI.

Back to top

See also: