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 return on investment/effort of automation. For instance, a fragile, unstable automation suite may require attended run sessions, thus making one of the most prominent promises of automation (to free the manual tester for other tasks) void. This chapter will describe various techniques to handle events and exceptions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset