Chapter 7. Using Classes

In this chapter, we will cover the following recipes:

  • Implementing a class
  • Implementing a simple search class
  • Implementing a generic Login class
  • Implementing function pointers
  • Implementing a generic Iterator

Introduction

This chapter describes how to use classes in VBScript, along with some very useful and illustrative implementation examples. Classes are a fundamental feature of object-oriented programming languages such as C++, C#, and Java. Classes enable us to encapsulate data fields with the methods and properties that process them, in contrast to global variables and functions scattered in function libraries. UFT already uses classes, such as with reserved objects (refer to Chapter 8, Utility and Reserved Objects), and ...

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.