LoadFunctionLibrary Statement


Loads the specified function library when this step runs. After the function library is loaded, the definitions in the library (functions, subroutines, classes) are available.

Note: This statement provides functionality similar to that provided by the ExecuteFile Statement, with the following differences:

  • LoadFunctionLibrary enables you to debug the functions in the function library during run-time.

  • For tests, the definitions in a function library loaded by LoadFunctionLibrary statement are available globally until the end of the run session, whereas the definitions in a file run by ExecuteFile statement are available only within the scope of the action that called the statement.

    For components, in both cases the definitions are available in the scope of the component that called the statement.




The path (or paths) of the function library to load.

You can specify one or more absolute file system paths, relative paths, or ALM paths for both tests and components. If you specify multiple paths, separate them using a comma delimiter.

Return Value



  • The function library is not listed in the following (except during the run session):

    • The Solution Explorer pane in UFT One.

    • The Errors pane in UFT One.

    • The Comments tab in the UFT One Tasks pane.

    • The Dependencies tab in the ALM Test Resources module.

      This can affect test or component maintenance because the function library can potentially be modified or deleted without anyone realizing that it is called by this test or component. Conversely, when performing maintenance on a test or component, this function library can be overlooked because it is not clearly visible as a resource.

  • If a function in the function library has the same name as a function in an associated function library (defined in the Folders pane of the Options dialog box), the function in the dynamically loaded function library is used.

    Similarly, if more than one function library is loaded dynamically, and these function libraries each contain a function with the same name, UFT One uses the function in the last loaded function library.

  • If a dynamically loaded function library defines and initializes a global variable or a class, the value remains in effect for the remainder of the run session or until a new value is defined, whichever comes first.

  • Run performance can be affected because the function library is loaded during the run session (and not when the test is opened).

  • At the end of a run session, all of the function libraries that were dynamically loaded are unloaded. You can view the steps that ran during the run session in the Run Results window.


See also: