RegisterUserFunc Statement


Enables you to add new methods to test object classes or change the behavior of an existing test object method during a run session.

When you use this statement, UFT One uses your user-defined function as a method of the specified test object class for the remainder of the run session, or until you unregister the method.

If the specified method name does not already exist for the test object class, it becomes a new method for the test object class. If the method name is a defined UFT One method for the test object class, your definition (temporarily) overrides the existing functionality of the specified method.

For more details on user-defined functions, see the Micro Focus Unified Functional Testing User Guide.


RegisterUserFuncTOClass, MethodName, FunctionName, SetAsDefault






The test object class for which you want to register the method.

You cannot register a method for a UFT One reserved object (such as Recover, Reporter, and the other objects listed in the Utility Objects section of the Micro Focus UFT One Object Model Reference for GUI Testing).



The method you want to register. The method name cannot contain spaces.



The name of your user-defined function. The function can be located in your action or in any library file associated with your test or component.



Optional. Indicates whether the registered function is used as the default operation for the test object.

Default = False

Note: When you select a test object in the Keyword View or Step Generator, the default operation is automatically displayed in the Operation column (Keyword View) or Operation box (Step Generator). For more details, see the Micro Focus Unified Functional Testing User Guide.



See also: