Run tests by using the command line

You can run tests by using the IBM® Rational® Integration Tester command line. The command line is useful in situations where Ant is not available.

The command has two distinct usages: By specifying all the arguments on the command line, and by using a parameter file to specify one or more configurations.

When you run a single configuration (specified by the -environment, -run, and -project arguments), you can specify all the arguments on the command line. Here is an example

RunTests [-licence <key>] [-noHTTP] [-noResultsPublishers] 
[-useResultsPublishers <pub_1>,<pub_2>] [-resultsServerLogging absolute|relative|ignore] 
-environment <environment name or ID> -project <file> -run "<res_1>;<res_2>"

You can also use a parameter file to specify one, or more, configurations. Here is an example:

RunTests [-licence <key>] [-noHTTP] [-noResultsPublishers] 
[-useResultsPublishers <pub_1>,<pub_2>] [-resultsServerLogging absolute|relative|ignore] 
-parameterFile <file>
Note: If you are specifying more than one test resource, they must be separated by a semicolon and enclosed in quotation marks.

For example:

C:\> "C:\Program Files\IBM\RationalIntegrationTester\RunTests" 
-noHTTP 
-useResultsPublishers MyPub,TIB_Pub -resultsServerLogging ignore 
-environment HotelApp -project 
C:\RationalIntegrationTesterProjects\HotelApp\HotelApp.ghp -run 
"HotelApp/Airline/booking/MakeBooking/CardType = Visa"

Note: If any of the command-line parameters include spaces, they must be enclosed in quotation marks.
The command-line parameters are described in the following table:
Table 1. Command-line parameters
-license <key> The license key <key>, if required, to use for running Rational Integration Tester.
-noHTTP An optional switch to disable the internal web server. This switch must not be used when you are running performance tests.
-noResultsPublishers An optional switch to disable any results publishers that can be configured in the project.
-useResultsPublishers <pub_1>,<pub_2> One or more results publishers to be enabled for publishing. Each publisher is designated by the name that it was given when created in Rational Integration Tester, Multiple publishers must be separated with a comma.
-resultsServerLogging absolute|relative|ignore Specifies how the Results Server URL is written to the console when tests complete. The argument has the following options:

∞ ignore: The report URL is not written to the console.

∞ absolute: The full URL is written to the console.

∞ relative: A URL relative to the project's current Results Server location is written to the console.

The default value is absolute.
-junitDir Indicates that JUnit reports are generated for all suites being ran and the reports are placed in the specified folder. The default is to not generate reports. For more information on the format of the output file, see JUnit style output
-input Path to an input properties file. The properties are converted to Tests Tags. For more information on Test Tags, see The Tag Data Store
-projectUser The user name for a secured project
-projectPass The password for a secured project
-loginAsAdmin Indicates to log in as the Administrator for a secured project. This requires the admin password to be specified using the -projectPass parameter
-overrideSlowFail Overrides the slow fail setting in a Suite's root Scenario. If set to 'ON', the suite will run in slow fail mode.When set to 'OFF' the suite will run in normal mode. When set to 'SCENARIO' the Scenario settings will be used. The default is 'SCENARIO'.
-environment <name> The name or ID of the Rational Integration Tester environment to use when running the test items.
Note: The internal ID field in the Documentation tab of the environment represents the environment ID that can be used as an alternative for the environment name.
-project <file> The full path to the Rational Integration Tester project file <file> that contains the specified environment and test resources.
-run <res_1>;<res_2> The full path, within the project, of the test resources <res_1>...<res_n> to be ran. You can also specify the resource ID instead of resource name.
Note: The internal ID field in the Documentation tab of the resource represents the resource ID that can be used as an alternative for the resource name.
-securityToken <token> Security token for authentication when domain security is enabled (optional). For more information, see Domain level security.
-parameterFile <file> The full path to a parameter file that contains run options for one or more resources (More information about this parameter is given in the following paragraphs).

You can set the project, environment, and run options in a parameter file, which you specify by using the parameterFile option.

You can specify the run options for one or more test resources, which are grouped by project and separated by a semicolon. As an example, consider a file that is named myparams.txt that has the following contents:

-project C:\Projects\AETesting\myproj.ghp -environment Env1 -run "creditTest1";"creditTest2";
-project C:\Projects\BWTesting\myproj.ghp -environment HotelApp -run "bookVisa";"bookMaestro";"regSuite1";"regSuite2";

You can use the parameter file in the RunTests command, as follows:

RunTests -noHTTP -resultsServerLogging ignore -parameterFile C:\RationalIntegrationTesterTests\myparams.txt

In the example file, the command runs the following resources:

Note: A final trailing semicolon is used in the parameter file to close the list of artifacts to run.

Checking the test status

After running the script, you can check the test status by running the following commands: The return code 0 indicates that the test has passed and 1 indicates that the test has failed.

Feedback