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:

Install the NodeJS environment

  1. Install the latest Node.js 18.x (x64) version.

  2. Create a directory and change the path to the new directory.

  3. Download the NodeJS CLI.

  4. Run the following command:

    npm install lrc-node-cli-1.0.0.tgz

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.

To see the test ID, open the test in the Load tests tab and click Test settings.

testId = 36
runId

The run ID of the result.

Go 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. Download and unpack the Java CLI.

  2. 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 ID for the test.

To see the test ID, open the test in the Load tests tab and click Test settings.

testId = 36
runId

The ID of the run result.

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

Back to top