ObjectLabel Property (Web Objects)

Applies to TestComplete 14.30, last modified on November 21, 2019

Description

Use the ObjectLabel property to get the label of the given web object. Depending on the object’s type, it can be either the text displayed by the object, or the text assigned to it by the <label> element (see below).

Declaration

TestObj.ObjectLabel

Read-Only Property String
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 that holds the web object’s label. It is determined in the following way:

  • For Button objects - The button’s caption.

  • For Fieldset objects - The text content of the object’s child Legend object.

  • For objects provided for third-party ASP.NET controls and for Sencha ExtJS objects - The object’s native property that specifies the object’s label or placeholder text.

  • For other web objects - The content of the label element, which is the direct parent of the appropriate element or whose for attribute is equal to the appropriate element’s id attribute, if such a label element exists on the tested web page.

See Also

contentText Property (Web Objects)

Highlight search results