Properties Object (Collection)

Description

A 0-based collection of Property items created by a Create Method statement. (Each Property item contains a property name and value pair and an indication of whether the value is evaluated as a regular expression.)

After you have added a set of Property items to your Properties collection object, you can specify the Properties object in place of a test object name or programmatic description in a step.

You can also create several Properties objects in your test if you want to use programmatic descriptions for several objects.

For more details on programmatic descriptions, see the UFT One User Guide.

Syntax

You can retrieve Property objects from a Description object using the syntax:

                Set PropObj=MyDesc ("PropName")
            

IMPORTANT

When working with Properties objects, you can use variables for the property item names or values to generate the object description based on properties or values you retrieve during a run session.

Methods and Properties

Method AddAdds the specified property item from another Properties object to your Properties object.
Method CountReturns the number of property items in the Properties collection.
ItemAccesses a specific property item in a Properties collection, to set or retrieve its value.
NameSets or retrieves the name of an existing property item in the Properties collection, or adds a new property item if the specified property item does not exist in the collection.
RegularExpressionIndicates whether the value of a property item in the Properties collection is a regular expression.
RemoveRemoves the specified property item from the Properties collection.
ValueSets or retrieves the value of an existing property item in the Properties collection, or adds a new property item if the specified property name does not exist in the Properties collection.

Back to top

Add Method

Description

Adds the specified property item from another Properties object to your Properties object.

Syntax

PropertiesColl.Add PropColl(Position)

Argument

Type

Description

PropColl(Position)

Variant

The item of the property collection you want to add.

Specify the item in the format:

DescObj2 (N), where N is the index position of the item you want to add from DescObj2 to your description object.

Index position numbers begin with 0.

Back to top

Count Method

Description

Returns the number of property items in the Properties collection.

Syntax

PropertiesColl.Count

Back to top

Item Method

Description

Accesses a specific property item in a Properties collection, to set or retrieve its value.

Syntax

PropertiesColl.Item(Item)

Argument

Type

Description

Item

Variant

The property item you want to access. Specify the name of the property or its index position. Position numbers begin with 0.

IMPORTANT

You can also access an item within a collection by specifying its name or index, without using the Item method. However, when you use the Item method to access an item in a collection, UFT One's statement completion feature displays the collection object's properties.

Back to top

Name Property

Description

Sets or retrieves the name of an existing property item in the Properties collection, or adds a new property item if the specified property item does not exist in the collection.

Syntax

To set a property name: PropertiesColl(PropIndex).Name = PropName

To retrieve a property name: PropName = PropertiesColl(PropIndex).Name

Argument

Type

Description

PropIndex

Number

The index position of the property item whose name you want to set or retrieve.

Index position values begin with 0.

PropName

String

The new name for the specified property, or the retrieved name.

Back to top

RegularExpression Property

Indicates whether the value of a property item in the Properties collection is a regular expression.

Note: By default, the values of all property items added to a Properties collection are treated as regular expressions. Use the RegularExpression property to change this setting for a specific property item in the collection.0

Syntax

PropertiesColl(Property).RegularExpression = BooleanSetting

Argument

Type

Description

Property

Variant

The property item for which you want to specify the regular expression value. Specify the name of the property or its index position in the collection. Index position numbers begin with 0.

BooleanSetting

Boolean

The new value for the specified property.

Back to top

Remove Method

Description

Removes the specified property item from the Properties collection.

Syntax

PropertiesColl.Remove Item

Argument

Type

Description

Item

String

The property item you want to remove. Specify the name of the property or its index position. Position numbers begin with 0.

Back to top

Value Property

Description

Sets or retrieves the value of an existing property item in the Properties collection, or adds a new property item if the specified property name does not exist in the Properties collection.

Syntax

To set a property value: PropertiesColl(Property).Value = PropVal

To retrieve a property value: PropVal = PropertiesColl(Property).Value

Argument

Type

Description

Property

Variant

The property item for which you want to set a value, or from which you want to retrieve a value.

Specify the name of the property or its index position in the collection. Index position values begin with 0.

PropValue

Variant

The new value for the specified property, or the value retrieved.

Back to top

See also: