Add Method

Supported in UFT One version 2022 and later.

Description

Adds a function library file to the specified position in the collection.

Syntax

Visual Basic
Public Sub Add( _
   ByVal FLPath As String, _
   Optional ByVal Position As Long = -1 _
) 

Parameters

ParameterDescription

FLPath

The ALM path of the function library file you want to add.

The ALM path is the location of the file in ALM. For example: [ALM\Resources] Resources\Libraries\Library1.qfl (for a file stored in the Test Resources module) or [ALM] Subject\MyTests\Library1.qfl (for a file stored as an attachment in the Test Plan module.)

You can specify multiple paths using a pipeline (vertical bar) separator, as described in the Remarks section.

Position

The position in which you want to add the function library file.

Position values begin with 1.

If you do not specify a position, the function library file is added to the end of the list (position=-1).

Remarks

You can specify multiple function library files using the format:
"[ALM\Resources] Resources\Libraries\Library1.qfl | [ALM] Subject\MyTests\Library1.qfl" (using the pipeline (vertical bar) separator)

This enables you to instruct UFT One to load multiple function libraries in a single command. (Using a single command helps improve the performance of loading the libraries.)

Example:

Instead of:

uftApp.AppArea.Resources.Libraries.Add "[ALM\Resources] Resources\Libraries\Library1.qfl"
uftApp.AppArea.Resources.Libraries.Add "[ALM] Subject\MyTests\Library1.qfl"

Use the following:

Dim files
files = "[ALM\Resources] Resources\Libraries\Library1.qfl | [ALM] Subject\MyTests\Library1.qfl"
uftApp.AppArea.Resources.Libraries.Add (files)

Example

The following example adds a function library to the function library collection in an application area:

Copy code
uftApp.NewAppArea "[ALM\Resources] Resources\manual\AA\AA3"

Set AAFunctionLibraries = uftApp.AppArea.Resources.Libraries ' Get the libraries collection object
Dim file1

file1 = "[ALM\Resources] Resources\manual\Add FL to AA\FL1.qfl"

AAFunctionLibraries.Add (file1)

uftApp.AppArea.Save

See Also

AAFunctionLibraries Collection