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

Overriding a Test Object method

In this recipe, we will see how to write a new implementation of a method for a TO.

Getting ready

From the File menu, navigate to New | Function Library… or use the Alt + Shift + N shortcut. Name the new function library as FR_RegFunc.vbs.

How to do it...

As always, with programming, the task needs to be addressed in an orderly fashion. Therefore, there is a series of implementation steps to follow:

  1. Analyze the requirement, which means ask questions. For example:
    • What are the missing functions?
    • To which object class is it relevant?
  2. Design the solution.
  3. Code the function.
  4. Test the function.
  5. Register the function to the required object class.

In the following example, we will write a function in FR_RegFunc.vbs that overrides ...

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