background image
<< Testcase - AnyWin class | Exceptions - Using do...except >>
Handling Exceptions
<< Testcase - AnyWin class | Exceptions - Using do...except >>
User's Guide
209
9
C
h
a
p
t
e
r
9
Handling Exceptions
This chapter describes techniques you can use to handle exceptions (errors)
that are generated when you run your scripts.
What you will learn
This chapter contains the following sections:
Default error handling
If a testcase fails (for example, if the expected value doesn't match the actual
value in a verification statement), SilkTest by default calls its built-in
recovery system, which:
Terminates the testcase
Logs the error in the results file
Restores your application to its default base state in preparation for the
next testcase
Topic
Page
Default error handling
209
Using do...except
210
Performing more than one verification in a testcase
211
Adding to the default error handling
212
Trapping the exception number
214
Writing an error-handling function
214
Programmatically logging an error
216
Defining your own exceptions
216
Enabling fault trapping
217