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:
-
Infragistics, Developer Express, JQuery UI, Telerik, YUI 2 objects and web test objects (web page elements) of the following types:
-
Buttons
-
Check boxes
-
Radio buttons
-
Combo boxes
-
Text boxes
-
Date pickers
-
Field sets
-
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 whosefor
attribute is equal to the appropriate element’sid
attribute, if such alabel
element exists on the tested web page.