Run scripts from your IDE on other LoadRunner products
LoadRunner Developer integrates with LoadRunner Cloud (LRC) or LoadRunner Enterprise (LRE), providing the ability to scale up your load tests without leaving your IDE.
Tip: Check out the videos:
About scaling your test from your IDE
When running tests using LoadRunner Developer, there is a limit of 50 Vusers. You can scale up your load tests by executing your DevWeb scripts on LRC or LRE, directly from any IDE.
To run this integration, you use the LoadRunner Developer CLI tool, ScaLRD, included in the LoadRunner Developer deployment package. In your IDE, you define a task to run ScaLRD for your DevWeb script, and run the test on LRC or LRE, as required.
Parameters for the tests are configured in the relevant uploader YAML file, for example, the number of Vusers to run.
Prerequisite: To execute the test, you need an LRC or LRE license, as relevant.
Tip: To get help within your IDE on usage, available flags, and examples, run a command in the IDE using the following arguments:
ScaLRD --help(for general information on LRC and LRE)
ScaLRD lrc--help(for information on LRC)
ScaLRD lre--help(for information on LRE)
Configure the YAML file
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 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.
For local configuration, you can 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.
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).
|workspace settings, for LRE only||Define the folder structure to use in LRE for the performance test, by defining names for the following parameters: testPlan, testSetFolder, and testSet. If the names are not defined, then the default name, AutoTest, will be used at runtime, for example, AutoTestPlan.|
|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 logged-in user. To email to additional recipients, enter one or more email addresses for the emailAddresses property.|
|locations, for LRC only||Define the LRC cloud locations and Vuser distribution to use for the test. For more information, see Define distribution across locations for LRC tests.|
|encryption||For encrypted data, define the key location. For details, see Mask and encrypt data.|
|Scenario and general settings||For example, the number of Vusers to run, ramp up time, duration, and logging.|
|Script exclude||This is a list of regular expressions defining files to exclude from the script when it is uploaded to LRC or LRE.|
For LRC tests, you can define the cloud load generator locations that will run your DevWeb script, and the percentage of Vusers that you want to distribute to each location. You define this information in the lrc_uploader.yml file.
Note: On-premises load generators are not supported when running tests from LoadRunner Developer.
To define location distribution for LRC tests:
- Run the test on LRC, as described in Run ScaLRD from your IDE. Note the LRC ID number for the test.
To obtain a list of the cloud locations available for the test, in your IDE run a command using the following argument:
%DEVWEB_PATH%\ScaLRD.exe lrc info locations <test ID in LRC>
Linux or macOS:
$DEVWEB_PATH/ScaLRD lrc info locations <test ID in LRC>
After running the command, a table of available LRC locations is displayed in the terminal window:
- Select the locations that you want to use for the test from the available locations (marked as Yes in the Available column).
In the lrc_uploader.yml file for the script, define the required locations and the distribution using the following format:
- name: <location name> The name of the location, as provided in the locations table. For example: aws-us-east-1 percent: <percentage of Vusers>
An integer defining the percentage of Vusers to run on this location. For example: 35
The sum of the percent values distributed across all locations must equal 100%.
- When you run the test again from LoadRunner Developer, any locations and Vuser distributions defined for the test within LRC are overwritten by the lrc_uploader.yml settings.
If the lrc_uploader.yml or 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:
- To decrypt an encrypted value:
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".
To scale your load tests in LRC or LRE, you define a task to run ScaLRD from your IDE.
Once the task is running, if you close it locally in your IDE, the test will continue to run. You can later return to the test from your IDE to continue monitoring its progress, or to get the results after execution is complete. For details, see Continue monitoring a test.
- 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.
Tip: Review the FAQ before using ScaLRD.
- Create your DevWeb script, and test it in LoadRunner Developer.
- Configure the required settings in the lrc_uploader.yml or lre_uploader.yml file, as appropriate.
- Open the script in your IDE.
Set up a task for ScaLRD to run the test.
When setting up the task in your IDE, configure the arguments and flags for the command line using the following format.
%DEVWEB_PATH%\ScaLRD.exe lrc <flags> run <DevWeb script folder path>
%DEVWEB_PATH%\ScaLRD.exe lre <flags> run <DevWeb script folder path>
Linux or macOS: LRC
$DEVWEB_PATH/ScaLRD lrc <flags> run <DevWeb script folder path>
$DEVWEB_PATH/ScaLRD lre <flags> run <DevWeb script folder path>
The following flags are available:
-host= The LRC host name with http/https protocol. -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. -keyLocation string The full path to a key file used to decrypt encrypted strings in the configuration file. -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.
-host= The LRE host name with http/https protocol. -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= The domain name of the user. -project= The LRE project name. -keyLocation string The full path to a key file used to decrypt encrypted strings in the configuration file. -testPlan string The script is uploaded to a test plan folder with this name. -testSet string The performance test is created under a test set with this name. -testSetFolder The test set is created under a test set folder with this 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.
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.
Run the ScaLRD task.
LRE test: The DevWeb script folder is uploaded to the test plan folder configured in the lre_uploader.yml file (parameter testPlan). If a test plan name is not configured, the script is uploaded by default to AutoTestPlan.
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 used for the test run.
If relevant, the email addresses for the result report are added in LRC.
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 test set and test set folder that are configured in the lre_uploader.yml file. If these parameters are not defined, then AutoTestSet and AutoTestSetFolder are used by default.
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 set up a task in your IDE to continue monitoring for a test that is running on LRC or LRE, after previously closing the local IDE task. This enables you to check on progress, or to get the results after execution is complete.
To continue monitoring a test:
Set up the task to continue monitoring the test. You can reference the test using either the script location or the test ID.
Configure the arguments for the command line using the following format:
%DEVWEB_PATH%\ScaLRD.exe lrc <flags> continue <DevWeb script folder path OR test ID in LRC>
%DEVWEB_PATH%\ScaLRD.exe lre <flags> continue <DevWeb script folder path OR test ID in LRE>
Linux or macOS: LRC
$DEVWEB_PATH/ScaLRD lrc <flags> continue <DevWeb script folder path OR test ID in LRC>
$DEVWEB_PATH/ScaLRD lre <flags> continue <DevWeb script folder path OR test ID in LRE>
- Run the task. The progress pane indicates if the test is still running, or if it has finished.
- When the test run is completed, you can view the summary report.
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:
- Create your DevWeb script, and test it in LoadRunner Developer.
- Open the script in VS Code.
Either open an existing tasks.json file, or add a new task.
To add a new task:
- Select Terminal > Configure Tasks (in older versions of VS Code, select Tasks > Configure Tasks).
- Select Create tasks.json file from template from the task list.
- In the Select a Task Template list, select Others. VS Code creates a tasks.json file as a basic template.
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.
- Save the file.
To run the test:
- In VS Code, select Terminal > Run Task.
- In the Select the task to run list, select your task (the label you defined previously).
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.
A brief replay summary is displayed, providing information on the run and a transaction summary. It also provides the path to the report, containing the full details and graphs for the test run.
Is a load test run from the LoadRunner Developer integration the same as a test run from the LRC or LRE UI?
Yes—when a load test is executed for the LoadRunner Developer integration using ScaLRD, it 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 with ScaLRD:
- 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 relevant folder in LRE (using the name defined in lre_uploader.yml, or by default to the AutoTestPlan folder if there is no name defined), 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 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 using ScaLRD, these settings will overwrite the settings in the LRC or LRE UI.
How can I add additional assets/groups to my load test?
Whenever you execute a test with ScaLRD, only the uploaded script asset (LRC) or group (LRE) is used for the test. You cannot run multiple assets or groups.
How can I change distribution for my LRC load test?
You can configure distribution across locations for your test in the lrc_uploader.yml file. For details, see Define distribution across locations for LRC tests.
How can I define monitors for my LRC load test?
You can set up monitors for the test in the LRC UI. When you execute the test again using ScaLRD, it uses the latest configuration in the LRC.
How can I change general settings for my LRC load test?
You can change some general settings using the LRC UI. Note that the email report address will be overwritten whenever the test is executed with ScaLRD.
How can I edit the SLA setting for my LRC load test?
When you execute the test using ScaLRD, the SLA for the test transactions in LRC is disabled. You can enable it again if you run the test from the LRC UI.
How can I configure a specific load generator for my LRE load test?
When you execute the test using ScaLRD, the load generator in LRE is selected automatically. You can select a different load generator in the LRE UI, and the selected load generator will be used for the next run of the test with ScaLRD.
Note: You can select only one load generator per test.