O'Reilly logo

Advanced UFT 12 for Test Engineers Cookbook by Jonathon Lee Wright, Meir Bar-Tal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing a class

In this recipe, you will learn the following:

  • The basic concepts and the syntax required by VBScript to implement a class
  • The different components of a class and interoperation
  • How to implement a type of generic constructor function for VBScript classes
  • How to use a class during runtime

Getting ready

From the File menu, navigate to New | Function Library…, or use the Alt + Shift + N shortcut. Name the new function library cls.MyFirstClass.vbs and associate it with your test.

How to do it...

We will build our MyFirstClass class from the ground up. There are several steps one must follow to implement a class; they are follows:

  1. Define the class as follows:
    Class MyFirstClass
  2. Next, we define the class fields. Fields are like regular variables, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required