Book Image

Advanced UFT 12 for Test Engineers Cookbook

Book Image

Advanced UFT 12 for Test Engineers Cookbook

Overview of this book

Table of Contents (18 chapters)
Advanced UFT 12 for Test Engineers Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Building a reusable component (action)


The controller was designed to load, configure, and execute Action Based Testing (ABT) or Business Process Testing (BPT), which are classes built as command wrappers with a common Run method in which the main flow of the Action is implemented. In this section, we will see how to implement such an action.

Getting ready

From the File menu, navigate to New | Function Library…, or use the Alt + Shift + N shortcut. Save the file as cls.Actions.vbs in the C:\Automation\Lib folder.

How to do it...

As mentioned before, a reusable component (action) is a class that implements the command wrapper design pattern. The following code shows the sample class Login as a typical example for an Action within this framework:

Class [Login]
    ' -----------------------------------------------------
    ' Reusable Action: Login
    ' Description: Login to the application   
    ' -----------------------------------------------------
    Public Status    
    Public Iteration...