Using do...except to Handle an Exception

The VerifyValue method, like all 4Test verification methods, raises an exception if the actual value does not match the expected (baseline) value. When this happens, Silk Test Classic halts the execution of the test case and transfers control to the recovery system. The recovery system then returns the application to the base state.

However, suppose you don’t want Silk Test Classic to transfer control to the recovery system, but instead want to trap the exception and handle it yourself. For example, you might want to log the error and continue executing the test case. To do this, you can use the 4Test do...except statement and related statements, which allow you to handle the exception yourself.