Test Script Services Reference

prevnext

Logging Commands


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.


Summary

Use the commands listed in the following table to write to the TestManager log.

Command Description
LogEvent Logs an event.
LogMessage Logs a message event.
LogTestCaseResult Logs a test case event.


LogEvent

Logs an event.


Syntax

tsscmd LogEvent [-result result] [-desc description] eventType 
[property=value ...] 

Element Description
result Specifies the notification preference regarding the result of the call. Can be one of the following:
  • NONE (default: no notification)

  • PASS

  • FAIL

  • WARN

  • STOPPED

  • INFO

  • COMPLETED

  • UNEVALUATED


description Contains the string to be put in the entry's failure description field.
eventType Contains the description to be displayed in the log for this event.
property=value Specifies one or more property-value pairs.


Return Value

This command exits with one of the following results:


Comments

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.


Example

This example logs the beginning of an event of type Login Dialog.

tsscmd LogEvent -d "Login script failed" "Login Dialog" 
ScriptName=Login LineNumber=1 

LogMessage

Logs a message.


Syntax

tsscmd LogMessage [-result result] [-desc description] message 

Element Description
result Specifies the notification preference regarding the result of the call. Can be one of the following:
  • NONE (default: no notification)

  • PASS

  • FAIL

  • WARN

  • STOPPED

  • INFO

  • COMPLETED

  • UNEVALUATED


description Specifies the string to be put in the entry's failure description field.
message Specifies the string to log.


Return Value

This command exits with one of the following results:


Comments

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.


Example

This example logs the following message: --Beginning of timed block T1--.

tsscmd LogMessage "--Beginning of timed block T1--"

LogTestCaseResult

Logs a test case result.


Syntax

tsscmd LogTestCaseResult [-result result] [-desc description] 
testcase [property=value ...]

Element Description
result Specifies the notification preference regarding the result of the call. Can be one of the following:
  • NONE (default: no notification)

  • PASS

  • FAIL

  • WARN

  • STOPPED

  • INFO

  • COMPLETED

  • UNEVALUATED


description Contains the string to be displayed in the event of a log failure.
testcase Identifies the test case whose result is to be logged.
property=value Optionally a list of one or more property name/value pairs.


Return Value

This command exits with one of the following results:


Comments

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.


Example

This example logs the result of a test case named Verify login.

tsscmd TestCaseResult "Verify login" Result=OK

prevnext


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