Command line interface

In this section, you will learn all the actions from the graphical user interface can also be performed from the command line.

These actions include:

  • Record a script
  • Compile a script
  • Play back a script, passing command-line arguments to the script
  • View and edit verification point and object map files
  • Invoke the Java/HTML enabler
  • Invoke the Application Configuration Tool

Core command line format

The core command line formats follow:

java <standard java options> -classpath hcl_ft.jar com.rational.test.ft.rational_ft <product options> or
java <standard java options> -jar hcl_ft.jar <product options>

The standard java options refer to the Java command line options such as -classpath <classpath> to set the classpath appropriately.

-classpath
If you use the first command-line format, you must explicitly include the hcl_ft.jar in the classpath. It can be found in the install directory. If you use the second command-line format, specify the full path of the rational_ft.jar hcl_ft.jar file after the -jar option. You do not need to specify a classpath or the class to run (com.rational.test.ft.rational_ft ). If you are using the product with PurifyPlus, use the first command-line format.
Note: If the external jar file or directory that is referenced in a project, does not meet the project path criteria, then such jar files must be added to the classpath.

See the API Reference (com/rational/test/ft/rational_ft) for a full list of the command-line options.

-projectpath
If you have dependencies on a project, then you must add the project path using the -projectpath option. If you have added other project dependencies to the functional test project, you can specify the project name using the -projectpath option. For example, Consider a scenario where you have a functional test script that uses a class from another project. To resolve this dependency, during a command line invocation, you must specify the dependent project name using the -projectpath option.
In a scenario where you have added external jar files or projects to a Rational® Functional Tester project and the playback for this is run from the command line prompt then add the jar file to the project path provided the jar file contains a Rational® Functional Tester project or the project that is added is a Rational® Functional Tester project.

Commonly used command line options

The following table lists the more commonly used command line options:
Table 1. Command line options
Parameter Description
-datastore <datastore directory> Use this option whenever a script is specified. For example, use it with -record or -playback
-record <script name> Use this option to record a new script (or in conjunction with -insertafter <line number> to insert recording into an existing script).

The script name is not a file name. It is a fully qualified class name using the dot (.) character to separate package/namespace and script class name. You can use -record <script name> to record Java or VB.NET scripts, depending on the project type

.
-playback <script name> Use this option to play back a Java script. You must specify the playback option at the end of the command. Rational® Functional Tester ignores any arguments specified after the playback option.
-edit <file> or -display <file> Use this option to edit or view a verification point or object map. The <file> can be a complete file name (with directory path). Use double-quotes if the name or path includes space characters.
-enable Use this option to open the Enable Environments dialog box to enable a specific environment.
-appconfig Use this option to open the Application Configuration Tool dialog box.
-inspector Use this option to open the Test Object Inspector Tool dialog box.
-compile Use this option to compile the test script for the first time before playback.
-compileall Use this option to compile all test scripts in the project for the first time before playback. If you use the -datastore option, you can compile all tests scripts in the datastore directory and subdirectories. (Requires 9.1.1.1 and newer)