Thursday, February 6, 2020

Error Handling in Tosca

Error Handling and TOSCA Errors
There is a difference between Exceptions and Errors:
·     Exceptions
The term "exception" is used with:
Code exceptions: Use try-catch blocks to handle those.
Tosca exceptions which are not fatal to the overall execution and can be handled manually or ignored. A verification failure, for example, will be logged and can be ignored (the execution does not stop).
·     Tosca Error
A Tosca error is a severe failure which prevents the execution from being continued. The execution will stop and a Tosca error dialog window will be shown.
As unhandled exceptions stop execution immediately, an overall exception handling is a must for a stable Custom Engine. The Custom Engine should be splitted into two sections. The custom specific part, which handles the control logic and the Tosca specific part, which handles the communication with the Tosca Execution Framework. The custom specific part has to throw exceptions with error details, which are passed to the Tosca specific section. This section handles the exceptions with a try-catch block and converts it into an Tosca exception. The custom specific part has to provide as many information in the exception as possible to inform the user why it has occurred and what can/should be done to solve it.
Error types
In the handling of errors and exceptions, Tosca differentiates between three types of errors:
§  Verification-Failure: verification does not provide the expected results (e.g. an invoice total differs from the TestCase definition).
§  Dialog-Failure: the application wants to steer a control which does either not exist or is not in an operational state. Application errors like crashes or jams (i.e. if the application is not responding) also belong to this category.
§  User Abort: Abort of the test execution by the user.
For each of these error types, the handling at the time of the test execution can be defined via Tosca Executor: Tosca Executor is used for executing tests. TestCases can be executed by using either the Tosca Commander™ or by starting Tosca Executor. The Tosca Executor is opened via the Windows start menu Start->All Programs->Tricentis->Tosca Executor. After the default installation the TOSCAExecutor.exefile is located at: %TRICENTIS_HOME%\dll\.


Recover

With this option,Tosca tries to continue the test execution in spite of the error. In this case, generally an unwanted window is closed and after a few seconds of waiting, the verification is performed again. If the error cannot be resolved by Recover, it is recorded. This setting is useful for applications with a dynamic screen layout where a heavy load on the server may cause delays, for instance in HTML/web applications.
When the option recovery is selected, the following Recovery attempts can additionally be specified: It is possible to specify exactly whether and how often the recovery should be repeated on the different levels.
The number of the recovery attempts can be defined on three different levels:
  1. on the level of a control, this means on individual fields or screen elements
  2. on the screen level, this means individual modules or screens
  3. on the level of a TestCase, this means an individual TestCase
Ignore
This setting tries to continue the test execution. The error is logged but ignored for further execution.
Require manual input
In case of an error the test execution is aborted if this option is enabled. Tosca displays either the Tosca Manual Engine or an error dialog, depending on the selected behavior in theSettings dialog for the setting In case of halt. This exception setting may be useful for test case creation or attended test executions.
Execution Status Icon
During text execution, an execution status tray icon is displayed in the info area of the Windows task bar. At the beginning, the icon is white and gradually turns blue as the test progresses.
A right mouse click on the execution status tray icon opens a context menu with the following functions:
§  Halt Execution
The test execution is paused and can be continued later.
§  User Abort
The test execution is aborted. The test result is transferred to Tosca Commander™.
§  Terminate Execution
The process of Tosca Executor stops immediately. This action terminates the communication between Tosca Executor and Tosca Commander™ and should only be used ifUser Abort does not stop the test execution

1 comment: