CLI tools
LoadRunner Cloud also provides CLI (command line interface) tools to enable you to run tests and get results when no CI plugin is available.
Note: This topic contains a number of instances where you need to enter the LRC server URL. You can get the URL by coping it from the address bar of the browser in which you opened LoadRunner Cloud. For example, if the URL in the address bar of the browser is https://loadrunner-cloud.saas.microfocus.com/home/?TENANTID=208294383&projectId=1
, copy the address https://loadrunner-cloud.saas.microfocus.com
.
NodeJS CLI
The NodeJS CLI tool enables you to do the following:
- Run a test (no results returned)
- Run a test and return results
- Get the status of a test run
- Get the results of a test run
Install the NodeJS environment
- Install NodeJS.
-
Create a script directory and change the path to the new directory.
- Download the NodeJS CLI.
- Unpack the lrc_cli.tgz file.
-
In the unzipped folder, storm-cli, run the following command:
npm install
Run commands
Open a command line and type one of the following, where authentication parameters can be either <username:password>
or <ClientID:ClientSecret>
:
Argument | Description | Example |
---|---|---|
testId |
The ID of the test. Navigate to Load Tests > General > Summary to see the test ID. |
testId = 36 |
runId |
The run ID of the result. Navigate to the Results page to see the run ID. |
runId = 48 |
connect | Your credentials to log into LoadRunner Cloud. | connect=MyUsername:Mypwd or MyClientId:MyClientSecret |
host | The URL of your LoadRunner Cloud tenant. | https://loadrunner-cloud.saas.microfocus.com |
tenant |
Your tenant id, specified in your LoadRunner Cloud URL. For example: |
354274891 |
project id |
Your project id, specified in your LoadRunner Cloud URL. Example: |
1 |
sendEmail |
Set to "true" to receive an email when the test completes. For example: |
sendEmail=true |
Java CLI
The Java CLI tool enables you to do the following:
- Run a test (no results returned)
- Run a test and return results
- Get the status of a test run
- Get the results of a test run
Install the Java CLI Environment
- Create a test definition. For details, see Define a load test.
Run commands
Open a command line and type one of the following commands, where the authentication parameters can be either <username:password>
or <ClientId:ClientSecret>
:
Argument | Description | Example |
---|---|---|
testId | The test's ID. Navigate to Load Tests > General > Summary to see the test ID. | testId = 36 |
runId | The ID of the run result. Navigate to the Results page to see the run ID. | runId = 48 |
connect | Your credentials to log into LoadRunner Cloud. | connect=MyUsername:Mypwd or MyClientId:MyClientSecret |
host | The URL of your LoadRunner Cloud tenant. | https://loadrunner-cloud.saas.microfocus.com |
tenant | Your tenant id, specified in your LoadRunner Cloud URL. Example: | 354274891 |
project id | Your project id, specified in your LoadRunner Cloud URL. Example: | 1 |
sendEmail | Set to "true" to receive an email when the test completes. Example: |
Security
When working with either the NodeJS CLI or the Java CLI, even though users can type the user name and password directly in the command line, we strongly recommend that you create a .ini file that contains the credentials and use this file as an argument in the command.
Important: OpenText encourages you to put your credentials in a .ini file instead of directly in a command line, as described below. By not using a .ini file, you may expose your system to increased security risks. You understand and agree to assume all associated risks and to not hold OpenText responsible in any way. It remains your sole responsibility at all times to assess your own regulatory and business requirements. OpenText does not represent or warrant that its products comply with any specific legal or regulatory standards applicable to you in conducting your business.
Create the file in the following format for username password authentication:
[connect] username=<username> or <ClientId> password=<password> or <ClientSecret> url=https://loadrunner-cloud.saas.microfocus.com
You can then substitute the argument config=<config file path> instead of connect=<authentication_parameters>@<host>. For example:
node cli run testId=<test number> config=<config file path> tenant=<tenant id>:<project id> sendEmail=<True/False>
Caution: The credentials are saved in the .ini file as plain text without any encryption. We strongly recommend that you protect this file by configuring access permissions and that you remove the file when it is no longer needed.