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 ...

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.