TestLibraries Collection > Methods > Add Method
Add Method
Adds a library file to the specified position in the collection.
Visual Basic
Public Sub Add( _
   ByVal LibraryPath As String, _
   Optional ByVal Position As Long = -1 _

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.

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).
  • 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 to load multiple function libraries in a single command. (Using a single command helps improve the performance of loading the libraries.)


    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"

  • Prior to QuickTest Professional 10.00, the LibraryPath argument for ALM paths was specified using an ALM virtual path, such as:

    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.

See Also