ObjectIdentifier Property (Web and XUL Objects)

Applies to TestComplete 14.70, last modified on April 22, 2021

Description

The ObjectIdentifier property returns a value that uniquely identifies a web object among other objects within the same parent object.

Declaration

TestObj.ObjectIdentifier

Read-Only Property Variant
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following objects:

View Mode

This property is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Property Value

A string or integer that specifies the object’s identifier. It is determined by one of the following values:

  • For Image objects (<img> elements) - the object’s namePropStr property value which holds the last component of the src URL (typically the file name).

  • For Button (<button> and <input type="button">), ResetButton (<input type="reset">) and SubmitButton (<input type="submit">) - the value attribute.

  • For Area objects (<area> elements) - the area’s title attribute value.

  • For other web page elements - the object’s id or name in the HTML code, changed in the following way:

    1. The value is checked against the dynamic identifier patterns specified in the project’s Object Identification properties (see Handle Dynamic Identifiers).

      If the value matches a wildcard pattern or a regular expression pattern with empty Stable ID Template, the value is ignored.

      If the value matches a regular expression pattern with non-empty Stable ID Template, TestComplete creates a new identifier for the object using this template. This is used, for example, to remove dynamic parts of the identifier.

    2. All characters other than Latin letters (A..Z a..z) and digits are replaced with underscores ( _ ).

    3. Subsequent underscores are replaced with a single underscore.

    4. Leading underscores are stripped.

    The project’s Identification attribute setting specifies which attribute - id or name - is used first.

  • The object’s zero-based index among the sibling objects of the same type.

Note: If the selected string identifier is the same as that of another object within the same parent object, TestComplete appends an underscore and index to make this identifier unique. For example, input, input_1, input_2 and so on.

Remarks

This property is available only if the Tree model of web objects is active.

See Also

ObjectType Property
idStr Property
namePropStr Property
Default Web Testing

Highlight search results