Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2025.1

...

Invoke Load Test from the command line to run the script:

Code Block
languagejava
lt.exe -cmd -run <PATH_TO_YOUR_SCRIPT> // WINDOWSWindows 
./loadtest loadtest -cmd -run <PATH_TO_YOUR_SCRIPT> // Linux and macOS

The -cmd argument starts Load Test in command line mode. The -run argument executes the specified Load Test script. Both arguments are required to run a script from the command line.

java
Code Block
language
lt.exe -cmd -run <PATH_TO_YOUR_SCRIPT> // WINDOWS 
./loadtest -cmd -run <PATH_TO_YOUR_SCRIPT> // Linux and macOS

...

When you run Load Test in command line mode, Load Test uses the license configured in the GUI mode by default. You can also dynamically request a license from a Parasoft License Server with the -licenseServer option. Specify the base URL of the License Server and use the -licenseVus option to specify the number of virtual users allowed by the license. Note that HTTP connections are not supported.

java
Code Block
language
titleWindows
lt.exe -cmd -run <PATH_TO_YOUR_SCRIPT> -licenseServer <BASE_URL> -licenseUsername username -licensePassword password -licenseVus <INTEGER>
Code Block
languagejava
titleLinux and macOS
./loadtest -cmd -run <PATH_TO_YOUR_SCRIPT> -licenseServer <BASE_URL> -licenseUsername username -licensePassword password -licenseVus <INTEGER>

Examples

text
Code Block
language
titleRequest a 100-VU Load Test license using authentication and an encoded password
-licenseServer https://licenseserver.mydomain.com -licenseUsername username -licensePassword abc0123456789def -licenseVus 100
text
Code Block
language
titleRequest an Unlimited VU Load Test license using authentication with literal password
-licenseServer https://licenseserver.mydomain.com:8443 -licenseUsername username -licensePassword password -licenseVus Unlimited
Code Block
languagetext
titleRequest a basic 5-VU Load Test license without authentication
-licenseServer https://licenseserver.mydomain.com:8443

...

Use the -loadtestserver flag and specify the port number to enable the Load Test to run remotely. The port number is the local machine's port on which the server is listening. If no port is specified, the default port of 8189 is used. 

Code Block
languagejava
titleWindows
lt -loadtestserver [PORT]
java
Code Block
language
titleLinux and macOS
./loadtest -loadtestserver [PORT]

...

encoded using the
OptionDescription
-cmdStarts Load Test in command line mode. Required to run Load Test locally.
-runSpecifies the Load Test script to run. Required to run Load Test locally. 
-helpShows help information. Does not run testing.
-licenseServer <BASE_URL>Specifies the base URL for the Parasoft License Server. By default, Load Test requests a license from the server configured in the GUI, but this option enables you to dynamically request a license. Optional.
-licenseUsername <USERNAME>Specifies the username associated with the license on the Parasoft License Server. If this argument is not specified, no authentication is used. Optional.
-licensePassword <PASSWORD/ENCODED_PASSWORD>Specifies the password or encoded password associated with the license on the Parasoft License Server. Passwords may be encrypted with AES 256-bit encryption using the soatestcli -encodepass command line option. If this argument is not specified, an empty password is used for authentication. Optional.
-licenseVus <VALUE>Specifies the number of virtual users allowed by the license requested from the server specified with the -licenseServer option. You can specify an integer value or unlimited for unlimited virtual users' licenses.

-loadtestserver [PORT] 

Starts the Load Test Server on the default port 8189 unless another port is specified. To start the Load Test Server on port 8999, for example, you would specify the port number in the command line argument such as:

lt.exe -loadtestserver 8999

-password <LONG_PASSWORD_STRING>Specifies a node-locked license to pass to Load Test.
-reserialize

Specifies a file path to Load Test assets that you want to reserialize into a different file format. See Reserializing Assets for more information.

-J<JVM_OPTION>

Specifies additional JVM options to pass to the Load Test JVM. (Note that there is no space between the -J and the option that follows it).

Examples:

lt -J-Xmx4g -J-Xms2g

lt -J-Dcom.sun.management.jmxremote

Load Test Script Commands

...

Code Block
2011.04.21 17:54:56 MDT | 53% complete | 32/60 seconds | passed 245/failed 0 | avg. VUs 4 |avg. HPS 8

Reserializing Assets
Anchor
reserialize
reserialize

You can reserialize Load Test assets to a new file format from the command line. To do so, follow this workflow:

  1. Open a SOAtest workspace that has the project file format you want to reserialize your assets to. The project file format of the workspace isdefined in the workspace's Misc preferences.
  2. Close SOAtest.
  3. Run Load Test from the command line with the -reserialize option, specifying the directories containing the assets you want to reserialize.

The -reserialize option is used to specify a list of directories containing Load Test assets to reserialize. It will automatically use the project file format of the SOAtest workspace most recently opened. This option takes a single argument with a list of file system paths. To specify multiple paths, use the default path-separator character for your OS (semicolon for Windows or colon for Linux/Mac). The paths you specify do not have to be in the SOAtest workspace providing the project file format, but matching files will be reserialized to that workspace's default format.

Example:

Code Block
lt.exe -cmd -reserialize <PATH_TO_ASSETS_FOLDER_1>;<PATH_TO_ASSETS_FOLDER_2> // Windows 
./loadtest -cmd -reserialize <PATH_TO_ASSETS_FOLDER_1>:<PATH_TO_ASSETS_FOLDER_2> // Linux and macOS

This option will reserialize .lt, .ltp, .metric, .ms, and .rpt files. However, .rpt files are always serialized as binary, not to the configured project file format.