OnStopTestCase Event

Applies to TestComplete 15.47, last modified on January 20, 2023

Occurs when a test case run is over.

Declaration

OnStopTestCase(SenderStopTestCaseParams) Parameters
Sender [in] Required Variant
StopTestCaseParams [in] Required A StopTestCaseParams object

Description

Occurs when TestComplete stops running a test case:

  • When the execution of any project test item marked as a test case is stopped (regardless of whether you run individual test items or the entire project).
  • When the execution of an arbitrary part of script code marked as a test case (by using the aqTestCase.Begin and aqTestCase.End methods) is finished.
  • When the execution of any BDD scenarios or features, or tests specified via tags is stopped.

You can create an OnStopTestCase event handler to perform actions after the test case execution is finished. For instance, to send information about the executed test case to an external test management system. For more information, see Integration With Test Management Systems (TMS).

Parameters

The event has the following parameters:

Sender

The Event control that processes the event.

StopTestCaseParams

An object whose properties contain information about the executed test case. All properties are read-only.

Property Description
Name String. Specifies the test case name.
Status

Integer. Specifies whether the executed test case was successful or not. Possible values:

  • 0 (lsOK) – The test case was executed successfully. Neither errors nor warning messages were posted to the test log.
  • 1 (lsWarning) – Warning messages were posted to the test log.
  • 2 (lsError) – Error messages were posted to the test log.
StatusAsText

String. Same as Status, but returns a text description of the status. Possible values:

  • OK – The test case was executed successfully. Neither errors nor warning messages were posted to the test log.
  • Warning – Warning messages were posted to the test log.
  • Error – Error messages were posted to the test log.
Duration Integer. Specifies the overall duration of the test case execution (in milliseconds).
FirstErrorMessage String. Contains the first error message posted to the test log during the test case execution.
FirstWarningMessage String. Contains the first warning message posted to the test log during the test case execution.

Remarks

  • If a test case is stopped on error, the event handler will ignore any commands that start a new run, for instance, KeywordTest.Run.

  • For information on how to create an event handler for this and other TestComplete events, see Handling Events.

See Also

OnStartTestCase Event
Integration With Test Management Systems (TMS)
Handling Events
Event Control

Highlight search results