Class widgets.HtmlXulElement
Extends
widgets.Element.
An Element that corresponds to an element of an HTML or Chrome document
Defined in: widgets.js.
Constructor Attributes | Constructor Name and Description |
---|---|
widgets.HtmlXulElement(locatorType, locator, owner)
HtmlXulElement is an Element that corresponds to an element of a
HTML or Chrome document.
|
- Fields borrowed from class widgets.Element:
- controller, document, elem, node, window
Method Attributes | Method Name and Description |
---|---|
click(left, top)
Clicks on the Element with the left mouse button.
|
|
doubleClick(left, top)
Double-clicks on the Element with the left mouse button.
|
|
keyPress(keycode, modifiers)
Performs a key press for the given keycode.
|
|
mouseDown(button, left, top)
Presses the selected mouse button down on the Element.
|
|
mouseUp(button, left, top)
Releases the selected mouse button on the Element.
|
|
rightClick(left, top)
Clicks on the Element with the right mouse button.
|
Class Detail
widgets.HtmlXulElement(locatorType, locator, owner)
HtmlXulElement is an Element that corresponds to an element of a
HTML or Chrome document. More specific behavior for each is defined in
the child classes HtmlElement and XulElement.
- Parameters:
- {String} locatorType
- The type of locator being supplied. Choices are:
- node
- A node, as in Mozmill's Elem()
- id
- An ID string, as in Mozmill's ID()
- xpath
- An XPath string, as in Mozmill's XPath()
- name
- A name string, as in Mozmill's Name()
- lookup
- A lookup string, as in Mozmill's Lookup()
- tag
- A JQuery-style element selector string
- {node|String} locator
- The actual locator. If locatorType is "node," a node object is expected. For all other types, a String is expected.
- {document|Element} owner
- The owner (parent) of this Element. The top of an Element map is owned by a document. Other members of the map are owned by their parent Elements.
Method Detail
{Boolean}
click(left, top)
Clicks on the Element with the left mouse button.
- Parameters:
- {Number} left Optional, Default: 0
- Relative horizontal coordinate inside Element.
- {Number} top Optional, Default: 0
- Relative vertical coordinate inside Element.
- Returns:
- {Boolean} true if succeeded, false otherwise.
{Boolean}
doubleClick(left, top)
Double-clicks on the Element with the left mouse button.
- Parameters:
- {Number} left Optional, Default: 0
- Relative horizontal coordinate inside Element.
- {Number} top Optional, Default: 0
- Relative vertical coordinate inside Element.
- Returns:
- {Boolean} true if succeeded, false otherwise.
{Boolean}
keyPress(keycode, modifiers)
Performs a key press for the given keycode.
Try to avoid the usage of the ctrlKey and metaKey modifiers if the
shortcut is a combination of Ctrl (Windows/Linux) and Cmd (Mac). In
this case, use accelKey instead which will work across operating systems.
- Parameters:
- {String} keycode
- Either a literal like 'b' or an enum like 'VK_ESCAPE'.
- {Object} modifiers Optional, Default: {}
- Indicates modifier keys. true means pressed.
- {Boolean} modifiers.ctrlKey Optional, Default: false
- The Ctrl key.
- {Boolean} modifiers.altKey Optional, Default: false
- The Alt/Option key.
- {Boolean} modifiers.shiftKey Optional, Default: false
- The Shift key.
- {Boolean} modifiers.metaKey Optional, Default: false
- The Meta/Cmd key.
- {Boolean} modifiers.accelKey Optional, Default: false
- Ctrl key on Windows/Linux, Cmd key on Mac.
- Returns:
- {Boolean} true if succeeded, false otherwise.
{Boolean}
mouseDown(button, left, top)
Presses the selected mouse button down on the Element.
- Parameters:
- {Number} button Optional, Default: 0
- The id of the button to press (0 - left, 1 - middle, 2 - right).
- {Number} left Optional, Default: 0
- Relative horizontal coordinate inside Element.
- {Number} top Optional, Default: 0
- Relative vertical coordinate inside Element.
- Returns:
- {Boolean} true if succeeded, false otherwise.
{Boolean}
mouseUp(button, left, top)
Releases the selected mouse button on the Element.
- Parameters:
- {Number} button Optional, Default: 0
- The id of the button to press (0 - left, 1 - middle, 2 - right).
- {Number} left Optional, Default: 0
- Relative horizontal coordinate inside Element.
- {Number} top Optional, Default: 0
- Relative vertical coordinate inside Element.
- Returns:
- {Boolean} true if succeeded, false otherwise.
{Boolean}
rightClick(left, top)
Clicks on the Element with the right mouse button.
- Parameters:
- {Number} left Optional, Default: 0
- Relative horizontal coordinate inside Element.
- {Number} top Optional, Default: 0
- Relative vertical coordinate inside Element.
- Returns:
- {Boolean} true if succeeded, false otherwise.