Raw Scripts
If you use Rational Robot using just a single script file, here is an example of the SQABasic
commands you will likely use:
- Dimension counter variables and constants. This could be done with an include statements.
- Launch test support utilities (such as performance loggers,
keyboard macro, or screen capture programs) that run in parallel with the test,
such as these DDE Driver Debug commands:
Breakpoints "ON"
CommandDebug "OFF"
TestDebug "ON"
RecordsDebug "OFF"
- Initialize run variables with DDE Counter commands such as GetSystemDateTime and
StartTestCase, Version,
StartProcedure, StartCycle, StartSuite
StartCounter
- Define handling of unexpected screens (such as Windows AutoComplete and application pop-ups).
- Create temporary work files being reused from prior tests
or copy in files needed for the test:
GetAttr, ChDrive, ChDir, FileAttr, FileCopy, Kill, RmDir,
- Connect to the Test Results database to signal start of test:
SQLOpen, SQLGetSchema, SQLError
- Start the application under test:
LaunchApplication - StartApplication "MyVBApp.exe"
or
StartWebBrowser - StartBrowser "http://www.yahoo.com/", "WindowTag=WEBBrowser"
or in RobotJ:
startApp("ClassicsJavaA");
- SetApplicationMap - linking application objects to internal identifiers:
- Invoke reusable functions to perform actions:
CallCycle, CallSuite, CallStep, CallScript
- Delay/Sleep/Pause so the application is ready to respond to user requests:
WaitForWebPage, WaitForGUI, WaitForGUIGone,
WaitForPropertyValue, WaitForPropertyValueGone
- SetFocus to a foreground process with a Window handle (HWND).
- SetContext to specifically recognize an object. Web Example:
Window SetContext, "WindowTag=WEBBrowser", ""
- Exercise application functionality operations by using the application's Navigational, GUI and other Controls
to select menu item, import file, input/change/delete data, save, print, export, etc.
InputKeys to send text to the specified component
InputCharacters to send character(s) to the specified component
- Analyze the results from
verification points and SQAScriptCmdFailure command to simulate script failures.
If Robot's Options | Error Recovery menu option "On Script
Command Failure" is set to "Continue Execution", any failure in a subsidiary script called will return to the shell script.
A global result variable returns all manner of status info to the shell script, including the last step or phase executed.
GetGUIImage to save the screen shot of a component to a bmp or jpg file
- Log results at key points in the script using
DDE Log Commands or these SQABasic commands:
SQALogMessage sqaNone,"Status is " & SQLQueryResult(1,I) & "" &
SQLQueryResult(2,I),""
- Update the Test Results database:
SQAVpLog, SQLRequest. SQLError
- CloseApplication and databases:
Window CloseWin, "", ""
SQLClose
- Do other clean-up to return to a starting point common to all test runs.
- Stop timer.
The Rational LogViewer is automatically displayed after the script is done.
|
|
|
|
|