Chapter 6. Event and Exception Handling

In this chapter, we will cover the following recipes:

  • Catching errors inside a function or subroutine
  • Creating and using a recovery scenario
  • Using a global dictionary for recovery

Introduction

The topic of exception handling is extremely important, because the robustness of an automation suite affects its reliability. An automated test may fail due to unhandled and unexpected events, such as the appearance of a pop-up dialog or window, an application crash, or a runtime error (for example, due to poor quality code or an object description that is outdated). If you do not consider such possibilities while designing your scripts, then it will reflect on your ability to rely on the suite and accordingly reduce the ...

Get Advanced UFT 12 for Test Engineers Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.