Add Method

Description

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

Syntax

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

Parameters

LibraryPath

The file system or 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 Important Information 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:
    "C:\Library1.qfl | C:\Library2.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:

    qtApp.Test.Settings.Resources.Libraries.Add  "C:\Library1.qfl"
    qtApp.Test.Settings.Resources.Libraries.Add "C:\Library2.qfl"

    Use the following:

    Dim files
    files = "C:\Library1.qfl | C:\Library2.qfl"
    qtApp.Test.Settings.Resources.Libraries.Add(files)

Example

Associate a Library File with a Test

See Also

TestLibraries Collection