Run scripts on LoadRunner Cloud
LoadRunner Developer provides the ability to scale up your load tests using LoadRunner Cloud (LRC), without leaving your IDE.
2020 SP1 update: This functionality is supported for LoadRunner Developer 2020 SP1 and later.
About scaling your test from your IDE
To scale up your load tests, you can execute your DevWeb scripts on LRC, 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.
The following are required to execute the tests:
- A LoadRunner Cloud license. (See Try LoadRunner Cloud)
- ScaLRD, the CLI tool for running the tests. ScaLRD is included in the LoadRunner Developer deployment package (from version 2020 SP2 - see Installation and configuration).
Configure the YAML file
The configuration file for running your scripts on LRC is lrc_uploader.yml. This .yml file contains customizable default values for the script run, with explanations for each parameter. For example, you can define the number of Vusers to run, ramp up time, duration, and logging settings.
The tenant settings for host, user, password, tenantId, and projectId are required, to enable communication with LRC.
- The tenant values can also be defined in the flags on the command line - see Run ScaLRD from your IDE.
The Password key can be deleted from the file, and instead entered during runtime.
emailAddresses: Enter one or more email addresses. The results report for the script run will be sent to all listed addresses.
Tip: The report is automatically emailed to the logged-in user.
The settings in the master lrc_uploader.yml file (located in the same directory as the ScaLRD executable) apply for all scripts that you execute on LRC.
You can also copy the lrc_uploader.yml 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 lrc_uploader.yml will override the settings in the original (master) lrc_uploader.yml.
To scale your load tests, you can run ScaLRD from any IDE. The following describes the overall process.
To run tests with any IDE:
- Create your DevWeb script, and test it in LoadRunner Developer.
- Configure the required settings in the lrc_uploader.yml file.
- Open the script in your IDE.
Set up a task for ScaLRD to run the test on LRC.
When setting up the task in your IDE, you configure the arguments and flags for the command line using the following format.
%DEVWEB_PATH%\ScaLRD.exe <flags> <DevWeb script folder path>
On Linux or macOS:
$DEVWEB_PATH/ScaLRD <flags> <DevWeb script folder path>
All flags (except the report) can be configured in the lrc_uploader.yml file. If you add them in the command line, the flag definitions will override any lrc_uploader.yml file definitions.
The relevant flags are as follows:
-host= The host name for LRC. -user= The username 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 path for the results report PDF (written to the script directory and sent by email).
Run the task. The DevWeb script folder is then uploaded to LRC.
If the script already exists in LRC (a script with the same folder name), then the script in LRC will be overwritten by the uploaded version (containing any changes made in LoadRunner Developer).
The test is executed on LRC, using the configuration settings in the lrc_uploader.yml file.
The test is given a run ID, generated by LRC. This ID can be used together with the script label, Autogenerated_<script name>, to identify the run in LRC.
If a test already exists in LRC with the same Autogenerated_<scriptname>, it will be used for the test run. The SLA settings for the test will be disabled, and the email addresses for the result report are added; other test settings will not be affected.
Note: SLA is disabled on LRC for the test, not just for the current run.
You can watch the run progress from the LRC API. For details, see the LoadRunner Cloud Help Center.
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 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.
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 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. 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 PDF, containing the full details and graphs for the test run.
Is a load test created from the LoadRunner Developer integration the same as a load test created in the LRC UI?
Yes—a test created using the LoadRunner Developer integration is like any other LRC load test.
Note: If you make configuration changes to the test in the LRC UI, when you execute the test again from the LoadRunner Developer integration, some of your configuration items might be overwritten.
How is my load test created in LRC?
When you execute your test from the LoadRunner Developer integration, LRC checks if there is an existing load test with the name Autogenerated_<scriptname>.
If the test exists, the script attached to it is cleared and replaced with the uploaded script. Otherwise, LRC creates a new load test for the script.
How can I add additional assets to my 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 the 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 UI. When you run the test again from the LoadRunner Developer integration, it uses the latest configuration in the LRC UI.
How can I change general settings for the load test?
You can change some general settings using the LRC UI. 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.
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 configuration file.
When you execute the test from the LoadRunner Developer integration, these settings will overwrite the settings in the LRC UI.