Chapter 4. Method Overriding

In this chapter, we will cover the following recipes:

  • Overriding a Test Object method
  • Registering a method to all classes
  • Using method overriding to support object subtypes
  • Adding a new method to a class

Introduction

Method overriding is a feature of object-oriented programming languages such as C++, C#, and Java. It enables us to adopt a method or property inherited from a base class in order to address specific requirements of a class. In certain cases, overriding a method is necessary; for example, when a method in the base class is defined as abstract, or when an interface is implemented.

In UFT, the need to override a method may arise. The reasons can be diverse, from handling a customized version of a common control, ...

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.