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.

NodeJS CLI

This tool enables you to do the following:

Install the NodeJS environment

  1. Install NodeJS.
  2. Create a script directory and change the path to the new directory.

  3. Download the NodeJS CLI.
  4. Unpack the lrc_cli.tgz file.
  5.  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>:

Command Project Code

Run a test (no results returned)

Yes
node cli run testId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id>:<project id> sendEmail=<True/False>
No
node cli run testId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id> sendEmail=<True/False>	

Run a test and return results

A .csv file is generated that contains the results of the test.

Yes
node cli runWithResult testId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id>:<project id> sendEmail=<True/False>
No
node cli runWithResult testId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id> sendEmail=<True/False>

Get the status of a test run

The status is returned to the console.

Yes
node cli status runId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id>:<project id>
No
node cli status runId=<run number> connect=<authentication_parameters>@<host> tenant=<tenant id>

Get the results of a test run

A .csv file is generated that contains the results of the test.

Yes
node cli getResult runId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id>:<project id>
No
node cli getResult runId=<run number> connect=<authentication_parameters>@<host> tenant=<tenant id>

 
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: https://loadrunner-cloud.saas.microfocus.com/home/?TENANTID=354274891

354274891

project id

Your project id, specified in your LoadRunner Cloud URL.

Example: https://loadrunner-cloud.saas.microfocus.com/home/?TENANTID=354274891&projectId=1

1
sendEmail

Set to "true" to receive an email when the test completes.

For example: sendEmail=true

sendEmail=true

Back to top

Java CLI

The Java CLI tool enables you to do the following:

Install the Java CLI Environment

  1. Install the Java Runtime Environment. We recommend JRE (Java Runtime Environment) version 8.

  2. Download and unpack the Java CLI.

  3. 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>:

CommandProject Code

Run a test (no results returned):

Yes
java -jar cli.jar run testId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id>:<project id> sendEmail=<True/False>
No
java -jar cli.jar run testId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id> sendEmail=<True/False> 	

Run a test and return results

A .csv file is generated that contains the results of the test.

Yes
java -jar cli.jar runWithResult testId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id>:<project id> sendEmail=<True/False>
No
java -jar cli.jar runWithResult testId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id> sendEmail=<True/False>

Get the status of a test run.

The status is returned to the console.

Yes
java -jar cli.jar status runId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id>:<project id>
No
java -jar cli.jar status runId=<run number> connect=<authentication_parameters>@<host> tenant=<tenant id>

Get the results of a test run

A .csv file is generated that contains the results of the test.

Yes
java -jar cli.jar getResult runId=<test number> connect=<authentication_parameters>@<host> tenant=<tenant id>:<project id>
No
java -jar cli.jar getResult runId=<run number> connect=<authentication_parameters>@<host> tenant=<tenant id>

 

ArgumentDescription 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
connectYour credentials to log into LoadRunner Cloud.connect=MyUsername:Mypwd or MyClientId:MyClientSecret
hostThe URL of your LoadRunner Cloud tenant.https://loadrunner-cloud.saas.microfocus.com
tenant

Your tenant id, specified in your LoadRunner Cloud URL.

Example: https://loadrunner-cloud.saas.microfocus.com/home/?TENANTID=354274891

354274891
project id

Your project id, specified in your LoadRunner Cloud URL.

Example: https://loadrunner-cloud.saas.microfocus.com/home/?TENANTID=354274891&projectId=1

1
sendEmail

Set to "true" to receive an email when the test completes.

Example: sendEmail=true

 

Back to top

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: Micro Focus 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 Micro Focus responsible in any way. It remains your sole responsibility at all times to assess your own regulatory and business requirements. Micro Focus 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.

Back to top