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)

  • Prior to QuickTest Professional 10.00, the LibraryPath argument for ALM paths was specified using an ALM virtual path, such as:
    "[QC-Attach];;Subject\qtp95;;\Library1.qfl"

    This format is no longer supported.  If you used this format in previous automation scripts, you should change your scripts to reflect the new format, as described in the Syntax Details section.

Example

Associate a Library File with a Test

See Also

TestLibraries Collection  | TestLibraries Members