Introduction to Custom Test Script Types |
There are two ways to extend TestManager to support a new test script type. One way is to create a test script type that is based on the Command Line test script type and that uses the Command Line test script execution adapter (TSEA) provided with TestManager. The procedure for doing this is explained in Adding a Command Line Test Script Type. The advantage of this method is simplicity: it requires no custom programming. The only requirement is that the test scripts you want to run from TestManager can be executed from the command line. The drawback of these scripts is that, while TestManager can execute them individually and also in suites that include test scripts of other types, the scripts are not fully integrated into TestManager. For example:
If you extend TestManager in this way, see The Command Line Interface to Rational Test Script Services. This manual explains tsscmd
, a utility that gives Command Line test scripts access to Rational Test Script Services. (The C bindings for these services are documented in Chapter 3). Command-line test scripts that do not use Test Script Services can be executed from TestManager but are not integrated into the TestManager logging, monitoring, and reporting framework.
The other way to extend TestManager is to create a custom test script type. This method, described in Adding a Custom Test Script Type, requires that you develop programs implementing the C APIs described in chapters 2 and 4 of this manual and, optionally, provide access to the Test Script Services documented in Chapter 3. For example, you can create adapters for currently unsupported scripting languages or software testing environments. Custom test script types are fully integrated into the TestManager framework, but they require considerably more effort to provide.
This example illustrates how, without doing any programming, to extend TestManager so that it can support test scripts written in a new source language. After you have followed these procedures, TestManager can manage test scripts written in Perl. Specifically, a TestManager user can view, edit, or play back Perl source test scripts. Additionally, Perl test scripts can be added to TestManager suites that include test scripts of other types.
Note that you can execute test scripts that use the command line adapter without adding a new test script type: see Running a Test Script with the Command Line Adapter. The procedure below is an alternative that allows such test scripts to be mananged (created or modified as well as executed) from TestManager.
C:\testscripts\perl
. The folder can be on a local or a network location.
In the Name box, type the name of the new test script type -- for example, Perl Script
. Optionally, type a description and select an owner. Only the owner can edit or delete this script type.
Click Use the command line console adapter and fill in the boxes as follows:
Type {testscriptpath}
exactly as shown.
The program you enter (in this case notepad
) must be in your path.
Click Use the command line execution adapter. In the Execution command line box, type the execution command line for a new script instance. In this example, type the following exactly as shown:
The program (perl
) must be in your path. (A copy that is released with TestManager is located in the Rational Test folder, which will be in your path by default.)
In the Options area, type the following Option Name and Option Value pair:
Option Name: _TMS_TSO_EXEC_COPY_TO_AGENT_FILELIST
Option Value: {testscript}
In the Name box, type a descriptive name for this source. Optionally, type a description and an owner. Only the owner can edit or delete this source.
The Name you type here is added to the TestManager File > New Test Script, File > Open Test Script, and File > Run Test Script lists. Select this name to create a new Perl script or edit, view, or run an existing Perl script.
In the Data path box, type the directory name (corresponding to Name) that you designated in step 1. This is where source files for test scripts of this type are located.
If the data path might vary from one local computer to another, click Computer specific. In this case, the TestManager user is prompted for the actual path of a script at the time of selection.
The Connection options box allows you to specify platform-specific execution options for the script type's executable file (in this case, for perl
). No connection options are needed for this example. Click OK and close the dialog box to conclude the procedure.
The tasks required to support a new custom test script type are as follows:
The TSEA API is the interface that allows TestManager to call a TSEA for a particular test script type.
The TSS API gives scripts of the new type access to services such as:
The TSCA allows TestManager to locate scripts of the new type and associated programs needed to manipulate the scripts. If a new test script type is file-based and can be displayed or edited using standard file-based viewers and editors, you can use the built-in test script console adapter for the new type. Otherwise, a custom TSCA is required.
Create the new test script type and give TestManager the names and locations of the TSCA, the TSEA, and the programs to be used to edit or view scripts of the new type. These procedures are explained in the TestManager online Help and in the Rational TestManager User's Guide. The procedures are similar to those described in Adding a Command Line Test Script Type.
Your code must reside in dynamic-link libraries (.dll in Windows, or .so in UNIX). During initialization, the TestManager TSEE dynamically links with the TSEA component of your adapter.
TSEA dlls must be placed in the Rational Test\tsea
folder under the Rational installation directory.
Rational TestManager Extensibility Reference | Rational Software Corporation |
Copyright (c) 2003, Rational Software Corporation | http://www.rational.com support@rational.com info@rational.com |