Command-Line Options

The JavaTest harness includes a set of command-line options that you can use to:

Run the JavaTest Harness in Batch Mode

The JavaTest harness provides two command-line options that you can use to start a test run in batch mode:

-batch
or
-nogui
Without starting the GUI, either the -batch or -nogui command-line option can be used to automatically execute the tests of a JavaTest 3.0 test suite described by a work directory or the tests of an older test suite described by a set of -param options.

See Running Tests in Batch Mode for information about using the -batch command-line argument.

Set Environment Variables

When you start the JavaTest harness, you can set an environment variable from the command line by including the following option:

-Ename=value Add -Ename=value to the command string to set an environment variable that is inherited in every test environment created.

The -Ename=value command line option tunnels in values from the external shell. The method used in previous versions of the JavaTest harness to tunnel in values from the external shell is now deprecated.

Include System Properties

When you start the JavaTest harness, you can include system properties from the command-line by including the following option:

-EsysProps Add -EsysProps to the command string to include all system properties in test execution environments.

Configure JavaTest To Use Agents

If you run the JavaTest harness using the GUI, use the Agent Monitor window to configure the harness for using agents.

However, when you run the JavaTest harness in batch mode, include the following command-line options to set the configuration for using agents.

-agentPoolPort port When you use an active agent to run tests, add -agentPoolPort and the port number to the command string to set the port for the Active Agent Pool.
-agentPoolTimeout #seconds When you use an active agent to run tests, add -agentPoolTimeout and the number of seconds to the command string to set the timeout for the Active Agent Pool.
-startAgentPool When you use an active agent to run tests, add -startAgentPool to the command string to start the Active Agent Pool.

Start With a Clean Desktop

When you start the JavaTest GUI, you can include a command-line option that loads a clean desktop:

-cleanDesktop Add -cleanDesktop to the command string to start the JavaTest GUI without using a previous desktop.

The JavaTest GUI will ignore the previous settings and open the Welcome to JavaTest dialog box.

Display JavaTest Version Information

Before starting the JavaTest harness you can query the system from the command line for information about the installed version of the harness:

-version Add -version to the command string to display version, location, and build information about the installed copy of the JavaTest harness.

Display Command-Line Help

Before starting the JavaTest harness you can use any one of three options to query the system for command-line help:

-help, -usage,
or
/?
Add -help, -usage, or /? to the command string to display command-line help.

Specify Parameters

If you are running a JavaTest 3.x test suite, the -params option is not required. Use the JavaTest Configuration Editor to make changes in the configuration file before running tests.

If you are running an older test suite designed to use parameter files and want to change settings from the command line, use -params param-options:

-params param-options You can change specific parameter settings by adding -params and one or more param-options at the end of the -batch command string.

Parameter Options

The param-options and their values specify parameters used to run tests:

-t testsuite
or
-testsuite testsuite
Specifies the test suite to run
-keywords keyword-expr Restricts the set of tests to be run based on keywords associated with tests in the test suite
-status status-expr Includes or excludes tests from a test run based on their status from a previous test run. Valid status expressions are error, failed, not run, and passed.
-exclude exclude-list-file Specifies an exclude list file. Exclude list files contain a list of tests that are not to be run. Exclude list files conventionally use the extension .jtx and are normally supplied with a test suite.
-envFile environment-file Specifies an environment file. Environment files contain test environments that JavaTest uses to run tests in your computing environment. You can specify an environment file for the JavaTest harness to use when running tests.
-env environment Specifies a test environment from an environment file
-concurrency number Specifies the number of tests run concurrently. If you are running the tests on a multi-processor computer, concurrency can speed up your test runs.
-timeoutFactor number Increases the timeout limit by specifying a value in the time factor option.

The timeout limit is the amount of time that the JavaTest harness waits for a test to complete before moving on to the next test. Each test's timeout limit is multiplied by the time factor value.

For example, if you specify a value of "2", the timeout limit for tests with a 10 basic time limit becomes 20 minutes.

-r report-directory
or
-report report-directory
Specifies the directory where the JavaTest harness writes test report files. If this path is not specified, the reports are written to a directory named report in the directory from which you started the JavaTest harness.
-w work-directory
or
-workDir workDirectory
Specifies a work directory for the test run. Each work directory is associated with a test suite and stores its test result files in a cache.