background image
<< The SQAShellExecute statement | Insert At Cursor >>
<< The SQAShellExecute statement | Insert At Cursor >>

Creating a Custom TestFactory Script

Automatically Generating Scripts
5-32
Creating a Custom TestFactory Script
The TestFactory script object provides another way to create a script. You can use the
script object to record a TestFactory script in Robot and keep it with the scripts that
you created automatically in TestFactory. This customizable script is a template,
written in SQABasic
, that contains essential header files, the basic steps that
TestFactory displays on the Outline tab for the script, and comments that tell you
where to insert script code.
If you instrumented the AUT, you can run the custom script from TestFactory to
get a code coverage value for it. TestFactory displays the code coverage value on the
Coverage tab after the script is run. You can view and run all of your Pilot-generated
scripts in Robot.
Creating and Opening a Custom TestFactory Script
To create a custom TestFactory script and open it in Robot:
1. Click a folder or other object in the application map as a destination for the script
object, and then click Insert > Script.
Alternatively, drag a script object from the Insert toolbar to a destination in the
application map.
2. Rename the script object, and then press
ENTER
.
3. To open the script in Robot, do one of the following:
Click Script > Open.
Click Tools, point to Rational Test, and then click Rational Robot.
Click Start Robot on the Tools toolbar.
Right-click the script object, and then click Open on the shortcut menu.
Recording Actions in a Custom TestFactory Script
Recording a custom TestFactory script in Robot is a two-part process. In the first
part, you record the actions TestFactory performs to drive the AUT to the base state
for testing. In the second part, you perform and record the actions that you want to
include in the test case.
To record as TestFactory drives the AUT to the base state for the script:
1. The custom TestFactory script contains code that starts and quits the AUT, and
comments that tell you where to place your code. In the shell script, click the
cursor after the comment
'Step: <Add code here to drive the AUT
to base state>
.