Run scripts using CLI

LoadRunner Developer enables you to execute your script locally from the command line, with up to 50 concurrent Vusers. No license is required.

Execute DevWeb scripts

To run a DevWeb script from the command line, you can define an execution mode command line argument, single or load, with the relevant flags. (If the command does not include the execution mode, single mode is used by default.)

After the flags, you define the script directory. This directory must contain a main.js file and a scenario.yml file, and optionally an rts.yml file.

The following table describes the execution modes and arguments:

Run mode Description
single

Runs either one or multiple iterations for a single Vuser, regardless of the supplied scenario.yml file.

The following arguments can be used:

  • iterations. The number of iterations that will be executed for a single Vuser. (Default = one iteration)
  • inspect. Enables the user to debug the script in Chrome DevTools (chrome://inspect/#devices).
  • Pacing. The waiting time (seconds) between two iterations. (Default = 0)
  • rts. The full file name of the runtime settings file to use to run the script. This will override the rts.yml file in the script directory. (For more information, see Customizing runtime settings.)
  • keyLocation. The location of a file containing an AES 256-bit key.

load

Runs the script, using the scenario settings defined in the script's scenario.yml file to schedule the Vusers. For more information, see scenario.yml.

In addition, the following arguments can be used:

  • rts. The full file name of the runtime settings file to use to run the script. This will override the rts.yml file in the script directory. (For more information, see Customizing runtime settings.)
  • keyLocation. The location of a file containing an AES 256-bit key.

Note for keyLocation: It is recommended to use your own key. If you do not have one available, you have the option to generate a key with DevWebUtils. See To generate an AES 256-bit key.

  • Single mode examples: The following commands execute multiple iterations of the script that resides in C:/MyScripts. The scenario defined in the scenario.yml file is ignored.

    Windows DevWeb.exe -mode=single -rts=C:\MyScripts\genericRts.yml -keyLocation=C:\Keys\secret1.txt -iteration=10 -pacing=3 C:\MyScripts\ExceptionalScript
    Linux/MacOS DevWeb -mode=single -rts=~/MyScripts/genericRts.yml -keyLocation=~/Keys/secret1.txt -iteration=10 -pacing=3 ~/MyScripts/ExceptionalScript
  • Load mode examples: The following commands execute the script that resides in C:/ScriptDirectory, using the scenario defined in the scenario.yml file.

    Windows

    DevWeb -mode=load C:\ScriptDirectory

    Linux/MacOS

    DevWeb -mode=load ~/ScriptDirectory

Back to top

See also: