HTMLObject

This object contains actions and properties for DOM elements of Web page.

Extends SeSSimulatedObject

Behavior Pattern: HTMLFirefoxBehavior

Property Summary

Property Description Getter Setter
Alt Alt of the element. GetAlt
Checked 'Checked' state of the element. GetChecked
Class Class of the element. GetClass
ClientX X-coordinate of the top left corner of the element relative to browser window. GetClientX
ClientY Y-coordinate of the top left corner of the element relative to browser window. GetClientY
Enabled 'Enabled' state of the element. GetEnabled SetEnabled
Height Height of the element. GetHeight
Href HREF of the element. GetHref
Id ID of the element. GetId
InnerText Inner text of the element. GetInnerText
Label Label of the element. GetLabel
Name Name of the element. GetName
NodeText Text of the element without children. GetNodeText
PageTitle Title of the HTML document. GetPageTitle
PageURL Location URL of the HTML document. GetPageURL
Style Style of the element. GetStyle
Tag Tag of the element. GetTag
Text Text of the element with normalized spaces. GetText
Title Title of the element. GetTitle
Value Value of the element. GetValue
X X-coordinate of the top left corner of the element. GetX
XPath XPath of the element. GetXPath
Y Y-coordinate of the top left corner of the element. GetY

Action Summary

Action Description
DoAddSelection Adds selection of specified option in multi-select element.
DoClick Clicks on HTML element (button, link).
DoDblClick Double-Clicks on HTML element (button, link).
DoDOMChildAt Returns n-th child (zero-based).
DoDOMChildrenCount Returns number of children elements for this one.
DoDOMConvert Creates a clone of this object converted to a requested type.
DoDOMFindParentWithAttribute Returns parent element (if any) with given attribute matching given string or 'regex:.
DoDOMGetAttribute Returns specified attribute.
DoDOMGetAttributes Returns all attributes of a node.
DoDOMNextSibling Returns next sibling element for this one.
DoDOMParent Returns parent element having this element.
DoDOMPrevSibling Return previous sibling element for this one.
DoDOMQueryCss Gets array of elements matching CSS selector on this object.
DoDOMQueryXPath Gets array of elements matching XPath query on this object.
DoDOMRoot Returns Root element having this element.
DoEnsureVisible Makes sure specified element is visible on the screen.
DoGetRect Finds screen rectangle for this object.
DoGetSelection Gets selected options text of a SELECT element.
DoSelect Selects specified element in <select> control.
DoSetCheck Sets specified state of check box.
DoSetText Sets text for input edit or textarea.

Property Detail

Alt

Alt of the element.

Type: string

Accessors: GetAlt

Checked

'Checked' state of the element.

Type: boolean

Accessors: GetChecked

Class

Class of the element.

Type: string

Accessors: GetClass

ClientX

X-coordinate of the top left corner of the element relative to browser window.

Type: number

Accessors: GetClientX

ClientY

Y-coordinate of the top left corner of the element relative to browser window.

Type: number

Accessors: GetClientY

Enabled

'Enabled' state of the element.

Type: boolean

Accessors: GetEnabled, SetEnabled

Height

Height of the element.

Type: number

Accessors: GetHeight

Href

HREF of the element.

Type: string

Accessors: GetHref

Id

ID of the element.

Type: string

Accessors: GetId

InnerText

Inner text of the element.

Type: string

Accessors: GetInnerText

Label

Label of the element.

Type: string

Accessors: GetLabel

Name

Name of the element.

Type: string

Accessors: GetName

NodeText

Text of the element without children.

Type: string

Accessors: GetNodeText

PageTitle

Title of the HTML document.

Type: string

Accessors: GetPageTitle

PageURL

Location URL of the HTML document.

Type: string

Accessors: GetPageURL

Style

Style of the element.

Type: string

Accessors: GetStyle

Tag

Tag of the element.

Type: string

Accessors: GetTag

Text

Text of the element with normalized spaces.

Type: string

Accessors: GetText

Title

Title of the element.

Type: string

Accessors: GetTitle

Value

Value of the element.

Type: string

Accessors: GetValue

X

X-coordinate of the top left corner of the element.

Type: number

Accessors: GetX

XPath

XPath of the element.

Type: string

Accessors: GetXPath

Y

Y-coordinate of the top left corner of the element.

Type: number

Accessors: GetY

Action Detail

DoAddSelection(optionText)

Adds selection of specified option in multi-select element.

Parameters:

Name Type Description
optionText string Element to select

Returns:

boolean: 'true' if successful, 'false' otherwise'

DoClick(x, y, forceEvent)

Clicks on HTML element (button, link).

Parameters:

Name Type Description
x number X coordinate to click.
Optional.
y number Y coordinate to click.
Optional.
forceEvent boolean Pass 'true' to force browser event without actual mouse click
Optional, Default: false.

Returns:

boolean: 'true' if successful, 'false' otherwise'

DoDblClick()

Double-Clicks on HTML element (button, link).

Returns:

boolean: 'true' if successful, 'false' otherwise'

DoDOMChildAt(n)

Returns n-th child (zero-based).

Parameters:

Name Type Description
n number n Index of the child element.

Returns:

SeSObject: n-th child.

DoDOMChildrenCount()

Returns number of children elements for this one.

Returns:

number: Number of children elements.

DoDOMConvert(type)

Creates a clone of this object converted to a requested type.

Parameters:

Name Type Description
type string Type of an object.

Returns:

SeSObject: New Object of requested type or HTMLObject if type not found, null if error occur.

DoDOMFindParentWithAttribute(attrName, match)

Returns parent element (if any) with given attribute matching given string or 'regex:...' expression.

Parameters:

Name Type Description
attrName string Name of an attribute.
match string Match string.

Returns:

SeSObject: Matched element or 'null'.

DoDOMGetAttribute(attrName)

Returns specified attribute.

Parameters:

Name Type Description
attrName string Name of an attribute.

Returns:

object: Attribute value.

DoDOMGetAttributes()

Returns all attributes of a node.

Returns:

array: Array of attributes.

DoDOMNextSibling()

Returns next sibling element for this one.

Returns:

SeSObject: Next sibling element.

DoDOMParent()

Returns parent element having this element.

Returns:

SeSObject: Parent element.

DoDOMPrevSibling()

Return previous sibling element for this one.

Returns:

SeSObject: Previous sibling element.

DoDOMQueryCss(css)

Gets array of elements matching CSS selector on this object.

Parameters:

Name Type Description
css string CSS selector.

Returns:

array: Array of matched elements.

DoDOMQueryXPath(xpath)

Gets array of elements matching XPath query on this object.

Parameters:

Name Type Description
xpath string Xpath query.

Returns:

array: Array of matched elements.

DoDOMRoot()

Returns Root element having this element.

Returns:

SeSObject: Root element having this element.

DoEnsureVisible(vAlign, hAlign)

Makes sure specified element is visible on the screen.

Parameters:

Name Type Description
vAlign string One of "start", "center", "end", or "nearest". Defaults to "start".
Optional.
hAlign string One of "start", "center", "end", or "nearest". Defaults to "nearest".
Optional.

Returns:

object: Rectangle of the element if it became visible, 'null' otherwise.

DoGetRect()

Finds screen rectangle for this object.

Returns:

object: object {x, y, w, h}

DoGetSelection(delim)

Gets selected options text of a SELECT element. Example: 'Option1,Option2'.

Parameters:

Name Type Description
delim string Separator between options.
Optional, Default: ,.

Returns:

boolean: String with option values separated by delim.

DoSelect(txt)

Selects specified element in <select> control.

Parameters:

Name Type Description
txt string Element to select

Returns:

boolean: 'true' if successful, 'false' otherwise'

DoSetCheck(bcheck)

Sets specified state of check box.

Parameters:

Name Type Description
bcheck boolean State to set

Returns:

boolean: 'true' if successful, 'false' otherwise'

DoSetText(txt)

Sets text for input edit or textarea.

Parameters:

Name Type Description
txt string Text to set

Returns:

boolean: 'true' if successful, 'false' otherwise'