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

Registering a method to all classes

In some cases, we may need to customize a method that is common to all TO classes, or at least to all references to a particular environment, such as the Web or Java. For example, suppose we need to customize the Click method and register all Web TO classes. To write a statement for each class is quite tedious, and it may be an error-prone practice. For example:

RegisterUserFunc "WebEdit", "Click", "AQTP_Click"
RegisterUserFunc "WebButton", "Click", "AQTP_Click"
RegisterUserFunc "WebRadiobutton", "Click", "AQTP_Click"

If the new implemented method needs to be registered to all classes of all environments, then it becomes impractical and undesirable to maintain this via code. We can manage such custom function ...

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