Standard properties available for functional testing HTML objects
Standard properties provide a common way to access properties and their values across browsers. This topic lists the standard properties available for HTML objects.
Most of these properties are modeled on HTML element attributes defined by the W3C.
Property | Use |
---|---|
.align | Value of the align attribute of the element. Valid values are bottom, middle, and top. |
.alt | Value of the alt attribute of an element. This is the "alternate" text for the element, usually displayed by the browser when the mouse hovers over the element. |
.border | Value of the border attribute of the element. Returns the number of pixels. |
.bounds | Rectangle that represents the bounding rectangle of the object in screen coordinates. |
.caption | For TABLE elements, the value of the caption attribute. For an HTML dialog, this is the name of the dialog. |
.cellIndex | Cell index of an element with respect to its row (>=0). |
.checked | Boolean value that indicates whether a check box is checked (true) or not (false). |
.class | TestObject class name; for example, "HtmlTable" for a TABLE element. |
.className | Value of the class attribute of an element (used for stylesheets in HTML). |
.clientRect | Bounding rectangle of the element in client coordinates. |
.code | Value of the code attribute of an APPLET element. |
.codeBase | Value of the codeBase attribute of an APPLET element. |
.colSpan | Value of the colSpan attribute of an element. |
.cookie | Current value of the cookie for the document. |
.coords | Value of the coords attribute of an element. This is a string containing the coordinates used to define the AREA element of a client-side image map. In the form x1, y1, x2, y2, and so on. |
.defaultChecked | Boolean value for the defaultChecked attribute of the element. |
.defaultSelected | Boolean value; when true indicates that the OPTION element in a SELECT element (listbox or dropdown) is selected by default when the page is displayed. |
.defaultValue | Value of the defaultValue attribute of the element. |
.disabled | Value of the disabled attribute of an element, returned as a boolean. If true, user input is currently disabled for this item. |
.hasFocus | Indicates whether the current element has focus. |
.hasScript | Boolean value; true when a script has been associated with actions on this element. |
.height | Value of the height attribute of an element. For an Image element, this is the display height in pixels for the image. |
.href | Value of the href attribute of an element. This is a URL used by ANCHOR and AREA elements to indicate the result of clicking the corresponding element. |
.hspace | Value of the hspace attribute of an element, the amount of whitespace inserted to the left or right of an IMG, OBJECT, or APPLET element. |
.id | Value of the id attribute of an element. |
.indeterminate | Boolean value; true when the status of the check box has been changed. |
.index | Index of the OPTION element within a listbox or combodropdown list. |
.isMap | Boolean value; for Image elements (IMG), this value is true when the element is a server-side image map. |
.length | Value of the length attribute of an element. For a SELECT element, this indicates the number of items in the list. |
.maxLength | For an edit control (Input type=Text or TextArea) this indicates the maximum number of characters a user can enter. |
.multiple | Boolean value; for a SELECT element (listbox or combo dropdown), a value of true indicates that the list supports multiple selections. |
.name | Value of the name attribute (Form elements and Frames only). |
.noHref | Value of the noHref attribute of an element. When set on an AREA element, indicates that the corresponding area has no associated action. |
.offsetHeight | Height of the element. |
.offsetLeft | Offset, in pixels, of the element from its left edge to the left edge of its parent element in the DOM. |
.offsetRight | Offset, in pixels, of the element from its right edge to the right edge of its parent element in the DOM. |
.offsetTop | Offset of the element from the offset of its parent element in the DOM. |
.offsetWidth | Width of the element. |
.readOnly | Value of the readOnly attribute of an element. Boolean value; true when the form element is read-only. |
.readyState | Current status of a browser, indicating whether it is currently loading a document or ready for user input. This is an integer value: 0 - Uninitialized 1 - Loading 2 - Loaded 3- Interactive 4 - Complete (ready) |
.rowIndex | Row index of an element in a table (>=0 ). |
.rows | Value of the rows attribute of a TEXTAREA element, indicating the size of the edit control in the number of rows of text. |
.rowSpan | Value of the rowSpan attribute of an element. |
.screenLeft | Upper left corner of bounding rectangle in screen coordinates, x component. |
.screenTop | Upper left corner of bounding rectangle in screen coordinates, y component. |
.select | Boolean value; true when the FORM element is highlighted to receive user input. |
.selected | Boolean value; true when the OPTION element in a SELECT element (listbox or dropdown) is selected. |
.selectedIndex | Value of the selectedIndex attribute of an element. For a single selection Select element, this indicates which option element is selected. Integer in the range of >=0. |
.shape | Value of the shape attribute of an element. Used for AREA elements in client-side image maps. Valid values are default, rect, circle, and poly. |
.size | Value of the size attribute of an element. For a Select element, the number of items displayed at one time in the list. If size > 1, the list appears as listbox; otherwise the list appears as a Combodropdown. |
.src | Value of the src attribute for the element. For images and image buttons, this is a URL specifying the image file. |
.tag | HTML tag for the element. |
.target | Value of the target attribute of an element. For anchors, this indicates the name of the target frame, that is, the frame where the document should be opened. |
.text | Text inside of the HTML tags for bounding the element. For example:
The text property returns "This is an Anchor." If consecutive white space characters are found, all white spaces are combined and reduced to a single blank character. |
.title | Value of the title attribute of an element. This is frequently the text displayed when hovering over the element with the mouse. |
.type | Value of the type attribute of an element. For example, for an Input element this is text, password, check box, radio, submit, image, reset, button, hidden, or file. |
.url | URL of the document. |
.useMap | Value of the useMap attribute of an element. The value is a string specifying a URL and is used for IMAGE elements (IMG) to indicate a client-side image map. The URL points to the map associated MAP element. Frequently, this is a document-relative reference. |
.value | Value of the value attribute of an element. In Form elements this represents the value sent when the form is posted. |
.vspace | Value of the vspace attribute of an element, the amount of whitespace inserted to the above or below an IMG, OBJECT, or APPLET element. |
.width | Value of the width attribute of an element. For an IMAGE element, this is the display width in pixels for the image. |
.window | Heavyweight window for the element returned as a long. For the Browser, this is the top-level window. |