Object Model Reference for GUI Testing > Utility Objects > Utility Statements > RegisterUserFunc Statement

RegisterUserFunc Statement

Description

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 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 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 HPE Unified Functional Testing User Guide.

Syntax

RegisterUserFuncTOClass, MethodName, FunctionName, SetAsDefault

Argument

Type

Description

TOClass

String

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

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

MethodName

String

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

FunctionName

String

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.

SetAsDefault

Boolean

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 HPE Unified Functional Testing User Guide.

IMPORTANT

 

See also: