Test Script Services Reference |
Use the logging commands to build the log that TestManager uses for analysis and reporting. You can log events, messages, or test case results.
A logged event is the record of something that happened. Use the environment variable LogEvent_control
(Arguments of EnvironmentOp) to control whether or not an event is logged.
An event that gets logged may have associated data (either returned by the server or supplied with the statement). Use the environment variable LogData_control
(Arguments of EnvironmentOp) to control whether or not any data associated with an event is logged.
Use the commands listed in the following table to write to the TestManager log.
LogEvent
Logs an event.
LogMessage
Logs a message event.
LogTestCaseResult
Logs a test case event.
tsscmdLogEvent
[-resultresult
] [-descdescription
]eventType
[property
=value
...]
This command exits with one of the following results:
result
was specified.
The event and any data associated with it are logged only if the specified result
preference matches associated settings in the LogData_control
or LogEvent_control
environment variables. (See Arguments of EnvironmentOp.) Alternatively, the logging preference can be set with the Log_level
and Record_level
environment variables. The STOPPED, COMPLETED, and UNEVALUATED preferences are intended for internal use.
This example logs the beginning of an event of type Login Dialog
.
tsscmd LogEvent
-d "Login script failed" "Login Dialog"
ScriptName=Login LineNumber=1
tsscmdLogMessage
[-resultresult
] [-descdescription
]message
This command exits with one of the following results:
An event and any data associated with it are logged only if the specified result
preference matches associated settings in the LogData_control
or LogEvent_control
environment variables. (See Arguments of EnvironmentOp.)
Alternatively, the logging preference can be set with the Log_level
and Record_level
environment variables. The STOPPED, COMPLETED, and UNEVALUATED preferences are intended for internal use.
This example logs the following message: --Beginning of timed block T1--
.
tsscmd LogMessage
"--Beginning of timed block T1--"
tsscmdLogTestCaseResult
[-resultresult
] [-descdescription
]testcase
[property
=value
...]
This command exits with one of the following results:
A test case is a condition, specified in a list of property name/value pairs, that you are interested in. This command searches for the test case and logs the result of the search.
An event and any data associated with it are logged only if the specified result
preference matches associated settings in the LogData_control
or LogEvent_control
environment variables. (See Arguments of EnvironmentOp.) Alternatively, the logging preference may be set by the Log_level
and Record_level
environment variables. The STOPPED, COMPLETED, and UNEVALUATED preferences are intended for internal use.
This example logs the result of a test case named Verify login
.
tsscmd TestCaseResult
"Verify login" Result=OK
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 |