Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

language
Code Block
javatitleWindows
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
language
Code Block
texttitleRequest an Unlimited VU Load Test license using authentication with literal password
-licenseServer https://licenseserver.mydomain.com:8443 -licenseUsername username -licensePassword password -licenseVus Unlimited
text
Code Block
language
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. 

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

Configuring a Remote Project

See Running Load Tests on Remote Machines for instructions.

Working with Load Test Machines Located on Different Networks

...

Scroll Table Layout
orientationdefault
sortDirectionASC
repeatTableHeadersdefault
widths35%,65%
sortByColumn1
tableStylingconfluence
sortEnabledfalse
cellHighlightingtrue

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

Scroll Table Layout
orientationdefault
sortDirectionASC
repeatTableHeadersdefault
widths20%,30%,50%
sortByColumn1
tableStylingconfluence
sortEnabledfalse
cellHighlightingtrue

CommandOption & option argumentsDescription
var

Format: var variable_name = variable_value

Declares a variable name and assigns it a value. Use ${variable_name} syntax to get the variable value.

open

Format: open path_to_load_test_project_file

Opens the specified project in Load Test. After a project is loaded, use the loadtest command.

loadtest

Format: loadtest [-settings path_to_local_settings_file] [-env environment_name] [-minutes number] [-vus number | -hps number] [-report path_to_report_file] [-html html_directory] [-allReports reportsPath] [-trimReportSeconds headSeconds tailSeconds][trimReportPercentage headPercentage tailPercentage]ScenarioName

Runs a test suite load test using the specified scenario and options. See the rows below for details.


-settings
path_to_local_settings_file
Specifies the path to the settings file, which contains configuration and preferences parameters (see Settings Files).

-env environment_nameSets the active environment. Environments are a part of the SOAtest project that are used by the Load Test.

-minutes numberSpecifies the test duration in minutes. If you specify a test duration in this command, it will override the test duration specified in the scenario.

-vus numberSets the number of virtual users for each machine in the load test configuration to the given Number. The execution mode is switched to "Weighted Profiles" mode and each machine in the load test configuration is configured to run a steady load with the specified number of virtual users.

-hps numberSets the number of hits per second for each machine in the load test configuration to the given Number. The execution mode is switched to "Weighted Profiles" mode and each machine in the load test configuration is configured to run a steady load with the specified number of hits per second.

-report path_to_report_fileSpecifies that you want to create a binary report with the given name

-html html_directorySpecifies that you want to create an HTML report with the given name in the specified directory.

-allReports reportsPathSpecifies that you want to create a binary, XML and HTML report under the given directory path.

-trimReportSeconds headSeconds tailSecondsSpecifies the duration (in seconds) to be trimmed from the beginning and the end of the report*. The seconds values must be non-negative integers. If the sum of the headSeconds and tailSeconds values is greater than the duration of the report, the trim operation will not be applied.

-trimReportPercentage headPercentage tailPercentageSpecifies the duration (in a percentage relative to the duration of the report) to be trimmed from the beginning and the end of the report*. The percentages must be non-negative integers. If the sum of the headPercentage and tailPercentage is equal to or greater than 100, the trim operation will not be applied.

*Load Test report data is collected and saved in approximately three-second intervals. The trimReport commands will discard all report collection points that fall into the specified trim intervals. Because the times of the report collection points and the specified trim values may not match, the actual duration trimmed from the beginning and end of the report may (and in most cases will) exceed the duration specified in the command line. The excess value trimmed from the head and the tail of the report will not exceed the duration of the data collection interval. For more details on how report fragments are saved, see Understanding Report Interval Selection.

Settings Files
Anchor
Local Settings Files
Local Settings Files

...

Each name/value pair must be on a separate line. Use the hash “#” symbol to comment the name/value entries.

Available Settings

SettingDescription
echo=true|falseIf “true” Load Test will echo the settings to the console. Default state is true. If this setting is used, it must be the first entry in the settings file.

console.log=enable

Anchor
console.log=enable
console.log=enable

Turns on console logging in command line mode. See Console Logging section below. Default is disabled.

Console Logging
Anchor
Console Logging
Console Logging

...

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 directory containing the assets you want to reserialize.

The -reserialize option is used to specify a directory 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 file system path. The path you specify does 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> // Windows 
./loadtest -cmd -reserialize <PATH_TO_ASSETS_FOLDER> // 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.