Test Script Services Reference |
When a suite of test cases or test scripts is played back, TestManager monitors execution progress and provides a number of monitoring options. The monitoring commands support the TestManager monitoring options.
The following table lists the monitoring commands.
Display
Sets a message to be displayed by the monitor.
PositionGet
Gets the script source file name or line number position.
PositionSet
Sets the script source file name or line number position.
ReportCommandStatus
Gets the runtime status of a command.
RunStateGet
Gets the run state.
RunStateSet
Sets the run state.
Sets a message to be displayed by the monitor.
tsscmdDisplay
message
message
The message to be displayed by the progress monitor.
This command exits with one of the following results:
This message is displayed until overwritten by another call to Display.
This example sets the monitor display to Beginning transaction. The quotes are optional.
tsscmd Display
"Beginning transaction"
Gets the test script file name or line number position.
LineAndFile
=`tsscmdPositionGet
`
On success, this command returns the name of the source file in use and the current line position. The command exits with one of the following results:
TestManager monitoring options include Script View, causing test script lines to be displayed as they are executed. PositionSet and PositionGet partially support this monitoring option for TSS scripts: if line numbers are reported, they are displayed during playback but not the contents of the lines.
The line number returned by this function is the most recent value that was set by PositionSet. A return value of 0 for line number indicates that line numbers are not being maintained.
This example gets the name of the current script file and the number of the line to be accessed next.
LineAndFile = `tsscmd PositionGet
`
Sets the test script file name or line number position.
tsscmdPositionSet
[-sourcesrcfile
]lineno
srcFile
The name of the test script, or NULL for the current test script.
lineNumber
The number of the line in
srcFile
to set the cursor to, or 0 for the current line.
This command exits with one of the following results:
TestManager monitoring options include Script View, causing test script lines to be displayed as they are executed. PositionSet and PositionGet partially support this monitoring option for TSS scripts: if line numbers are reported, they are displayed during playback but not the contents of the lines.
This example sets access to the beginning of test script checkLogin
.
tsscmd PositionSet
-s checkLogin 0
Reports the runtime status of a command.
tsscmdReportCommandStatus
status
status
The status of a command. Can be one of the following:
This command exits with one of the following results:
status
is invalid.
This example reports a failure command status.
tsscmd ReportCommandStatus
FAIL
state
=`tsscmdRunStateGet
`
On success, this command returns one of the run state values listed in the run state table starting on page76. The command exits with one of the following results:
This call is useful for storing the current run state so you can change the state and then subsequently do a reset to the original run state.
This example gets the current run state.
orig = `tsscmd RunStateGet
`
tsscmdRunStateSet
state
state
The run state to set. Enter one of the run state values listed in the run state table starting on page76.
This command exits with one of the following results:
TestManager includes the option to monitor script progress individually for different virtual testers. The run states are the mechanism used by test scripts to communicate their progress to TestManager. Run states can also be logged and can contribute to performance analysis reports.
The following table lists the TestManager run states.
This example sets the run state to WAITRESP
.
tsscmd RunStateSet
WAITRESP
The Command Line Interface to Rational Test Script Services | Rational Software Corporation |
Copyright (c) 2003, Rational Software Corporation | http://www.rational.com support@rational.com info@rational.com |