Java Application Parameters

Applies to TestComplete 15.20, last modified on January 19, 2022

The Tested Applications collection can include Java and JavaFX applications. The parameters of Java tested applications in the TestedApps editor are organized into two sections - Basic Parameters and Run-Mode Parameters.

Basic Parameters

Basic parameters include the following:

Parameter Description
Name The unique name of the tested application in the Tested Applications collection. This name is used to refer to the application in tests, for example, in the Run TestedApp keyword test operation.
Count The number of application instances that will be simultaneously launched during the test recording or run.
Autorun application on recording Select this option to have the application launched automatically when you start test recording.
Launch application from tests Uncheck this option to prevent the application from being launched by the Run TestedApp keyword test operation and the TestedApps.AppName.Run scripting method.

For example, you can define several instances of the tested application with different configurations and “disable” those not needed at the moment.

Use special runtime object This option controls the scripting interface to the tested application.

If it is enabled, you can get and set the application parameters directly via the TestedApp.AppName object. This object is a JavaTestedApp object.

If it is disabled (not recommended except for legacy tests), TestedApp.AppName returns a generic TestedApp object that contains properties and methods common to all application types. To set Java-specific parameters, use the TestedApps.AppName.Params.JavaParams property.

Run-Mode Parameters

The following parameters are specific to Java applications in the Tested Applications collection:

Parameter Description
Java Virtual Machine to use The fully-qualified path to the Java Virtual Machine launcher that will be used to run the Java application. There are two Java launchers: java.exe and javaw.exe. They are identical with the only difference being that java.exe shows a console window whereas javaw.exe does not show the console window. Consequently, if the application launch fails for some reason, java.exe writes error information to the console whereas javaw.exe displays a dialog box with an error.

You can select the needed Java launcher from the drop-down list or click the button and browse for the desired Java launcher file on your computer.

Specify application’s .jar file Use this option if you are testing a Java application in the form of an executable JAR file and specify the JAR file path. Note that the JAR file must specify the startup class in its Main-Class manifest header, otherwise the application cannot be launched.

You can type the .jar file name manually or you can click the button and browse for the desired JAR file on your computer.

The file path can include environment variables, such as %PROGRAMFILES%, as well as project and project suite variables in the format $(VarName). For more information, see Using Variables in Tested Application Paths.

Specify application’s entry point Use this option if you are testing a Java application in the form of one or more .class files or a JAR file that does not have a startup class defined in the manifest. In the edit box, specify the name of the application class to be invoked.

When using this option, you must also specify the Class paths, that is the list of folders, .jar files or .zip files to search for the application’s classes.

Command-line arguments The command-line arguments for the Java application that will be passed to the application’s main method. Do not confuse this with Java Virtual Machine arguments.
Environmental options The command-line options for the Java Virtual Machine launcher. For information on the available options, see the documentation on the Java Virtual Machine command line.
Working folder The working folder for the application run. You can enter the folder path manually or click the button and browse for the needed folder.

The folder path can include environment variables, such as %PROGRAMFILES%, as well as project and project suite variables in the format $(VarName). For more information, see Using Variables in Tested Application Paths.

Class paths A list of folder paths, .jar files or .zip files to search for developer-defined and third-party Java classes used in the tested Java application. When using the Specify application’s entry point option, you need to add the location of a specific class to this list.

To add a folder path, click Add Folder and browse for the needed folder on your computer.

To add a .jar or .zip file containing Java classes, click Add JAR File and then browse for the needed file.

To change the search order of class paths, use the Move Up and Move Down buttons.

To remove a specific entry from the list, click Remove.

Note: Specifying the Class paths list overrides any setting of the CLASSPATH environment variable.

See Also

About Tested Applications
Java Web Start Application Parameters
Testing Java Applications
Testing JavaFX Applications
Adding Java and JavaFX Applications to the List of Tested Applications
About TestedApps Editor
Run Modes and Parameters
Using Variables in Tested Application Paths

Highlight search results