Test Script Services

prevnext

Monitor Services


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 functions support the TestManager monitoring options.


Summary

The following table lists the monitoring functions.

Function Description
TSSDisplay() Sets a message to be displayed by the monitor.
TSSPositionGet() Gets the script source file name or line number position.
TSSPositionSet() Sets the script source file name or line number position.
TSSReportCommandStatus() Gets the runtime status of a command.
TSSRunStateGet() Gets the run state.
TSSRunStateSet() Sets the run state.


TSSDisplay()

Sets a message to be displayed by the monitor.


Syntax

s32 TSSDisplay(char *message)

Element Description
message The message to be displayed by the progress monitor.


Return Value

This function exits with one of the following results:


Comments

This message is displayed until overwritten by another call to TSSDisplay().


Example

This example sets the monitor display to Beginning transaction.

s32 retVal = TSSDisplay("Beginning transaction");

TSSPositionGet()

Gets the test script file name or line number position.


Syntax

s32 TSSPositionGet(char **srcFile, u32 *lineNumber)

Element Description
srcFile OUTPUT. The name of a source file. After a successful call, this variable contains the name of the source file that was specified with the most recent TSSPositionSet() call.
lineNumber OUTPUT. The name of a local variable. After a successful call, this variable contains the current line position in srcFile .


Return Value

On success, this function returns srcFile and lineNumber as explained in the preceding table. The function exits with one of the following results:


Comments

TestManager monitoring options include Script View, causing test script lines to be displayed as they are executed. TSSPositionSet() and TSSPositionGet() 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 TSSPositionSet(). A return value of 0 for line number indicates that line numbers are not being maintained.


Example

This example gets the name of the current script file and the number of the line to be accessed next.

char ** scriptFile;
u32 *lineNumber;
s32 retVal = TSSPositionGet(scriptFile,lineNumber);

See Also

TSSPositionSet()


TSSPositionSet()

Sets the test script file name or line number position.


Syntax

s32 TSSPositionSet(char *srcFile, u32 lineNumber)

Element Description
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.


Return Value

This function exits with one of the following results:


Comments

TestManager monitoring options include Script View, causing test script lines to be displayed as they are executed. TSSPositionSet() and TSSPositionGet() 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.


Example

This example sets access to the beginning of test script checkLogin.

s32 retVal = TSSPositionSet("checkLogin",0);

See Also

TSSPositionSet()


TSSReportCommandStatus()

Reports the runtime status of a command.


Syntax

s32 TSSReportCommandStatus(s32 status)

Element Description
status The status of a command. Can be one of the following:
  • TSS_CMD_STAT_FAIL

  • TSS_CMD_STAT_PASS

  • TSS_CMD_STAT_WARN

  • TSS_CMD_STAT_INFO


Return Value

This function exits with one of the following results:


Example

This example reports a failure command status.

s32 retVal = TSSReportCommandStatus(TSS_CMD_STAT_FAIL);

TSSRunStateGet()

Gets the run state.


Syntax

s32 TSSRunStateGet(void)

Return Value

On success, this function returns one of the run state values listed in the run state table starting on page92. The function exits with one of the following results:


Comments

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.


Example

This example gets the current run state.

s32 orig = TSSRunStateGet();

See Also

TSSRunStateSet()


TSSRunStateSet()

Sets the run state.


Syntax

s32 TSSRunStateSet(RunState state)

Element Description
state The run state to set. Enter one of the run state values listed in the run state table starting on page92.


Return Value

This function exits with one of the following results:


Comments

RunState is defined as follows:

typedef u32 RunState;

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.

Run State Meaning
MST_BIND iiop_bind in progress
MST_BUTTON X button action
MST_CLEANUP cleaning up
MST_CPUDLY cpu delay
MST_DELAY user-requested delay
MST_DSPLYRESP displaying response
MST_EXITED exited
MST_EXITSQABASIC exited SQABasic code
MST_EXTERN_C executing external C code
MST_FIND find_text find_point
MST_GETTASK waiting for task assignment
MST_HTTPCONN waiting for http connection
MST_HTTPDISC waiting for http disconnect
MST_IIOP_INVOKE iiop_invoke in progress
MST_INCL mask including above basic states
MST_INIT doing startup initialization
MST_INITTASK initializing task
MST_ITDLY intertask delay
MST_MOTION X motion
MST_PMATCH matching response (precv)
MST_RECV_DELAY line_speed delay in recv
MST_SATEXEC executing satellite script
MST_SEND httpsocket send
MST_SEND_DELAY line_speed delay in send
MST_SHVBLCK blocked from shv access
MST_SHVREAD V_VP: reading shared variable
MST_SHVWAIT user requested shv wait
MST_SOCKCONN waiting for socket connection
MST_SOCKDISC waiting for socket disconnect
MST_SQABASIC_CODE running SQABasic code
MST_SQLCONN waiting for SQL client connection
MST_SQLDISC waiting for SQL client disconnect
MST_SQLEXEC executing SQL statements
MST_STARTAPP SQABasic: starting app
MST_SUSPENDED suspended
MST_TEST test case, emulate
MST_THINK thinking
MST_TRN_PACING transactor pacing delay
MST_TUXEDO Tuxedo execution
MST_TYPE typing
MST_UNDEF user's micro_state is undefined
MST_USERCODE SQAVu user code
MST_WAITOBJ SQABasic: waiting for object
MST_WAITRESP waiting for response
MST_WATCH interactive -W watch record
MST_XCLNTCONN waiting for http connection
MST_XCLNTCONN waiting for socket connection
MST_XCLNTCONN waiting for SQL client connection
MST_XCLNTCONN waiting for X client connection
MST_XCLNTDISC waiting for http disconnect
MST_XCLNTDISC waiting for socket disconnect
MST_XCLNTDISC waiting for SQL client disconnect
MST_XCLNTDISC waiting for X client disconnect
MST_XMOVEWIN X move window
MST_XQUERY X query function
MST_XSYNC X sync state during X query
MST_XWINCMP xwindow_diff comparing windows
MST_XWINDUMP xwindow_diff dumping window
N_MST_INCL number of above states


Example

This example sets the run state to MST_WAITRESP.

s32 retVal = TSSRunStateSet(MST_WAITRESP);

See Also

TSSRunStateGet()

prevnext


Rational TestManager Extensibility Reference Rational Software Corporation
Copyright (c) 2003, Rational Software Corporation http://www.rational.com
support@rational.com
info@rational.com