public abstract class DOMElementDecorator extends DOMNodeDecorator implements DOMElement
DOMNode.Type
Modifier and Type | Field and Description |
---|---|
protected DOMElement |
decoratedElement |
decoratedNode
Constructor and Description |
---|
DOMElementDecorator(DOMElement element)
Constructs a new decorator for the DOMElement given as input
|
Modifier and Type | Method and Description |
---|---|
DOMWindow |
click()
Simulates a real mouse left click on an element.
|
boolean |
click(boolean waitUntilLoaded)
Simulates a real mouse left click on an element.
|
DOMWindow |
fireFocusEvent(String event)
Performs the specified focus/blur event (see
DOMFocusEvent ) on this element element and waits until the
document at the new location (if any), is fully loaded. |
DOMWindow |
fireKeyboardEvent(String event,
char printableChar)
Performs the specified focus event (see
DOMKeyboardEvent ) on this element element and waits until the
document at the new location (if any), is fully loaded. |
DOMWindow |
fireMouseEvent(String event)
Performs only the specified mouse event (see
DOMMouseEvent ) on this element element and waits until the
document at the new location (if any), is fully loaded. |
DOMWindow |
focus()
Simulates a real focus event (also generates the blur on the current active element if any).
|
String |
getAttribute(String name)
Gets an attribute by name
|
DOMBoundingClientRect |
getBoundingClientRect()
Gets the
DOMBoundingClientRect for the element, relative to the document, i.e., taking into account window
scrolling |
DOMCSSStyleDeclaration |
getComputedStyle()
Gets the computed style object
|
String |
getInnerHTML()
Inner html
|
HTMLUtil |
htmlUtil()
Returns an object that allows to cast down this element to HTML DOM specific implementations
|
DOMWindow |
keypress(DOMKeyboardEvent.Key content) |
DOMWindow |
mouseover()
Simulates a real mouseover event (mousemove and mouseover).
|
DOMElement |
querySelector(String selectors) |
DOMNodeList |
querySelectorAll(String selectors) |
void |
removeAttribute(String name)
remove an attribute by name
|
DOMWindow |
sendClick(float x,
float y)
Sends a click event on the given coordinates
|
void |
setAttribute(String name,
String value)
set an attribute on the element.
|
DOMWindow |
type(String content)
Enter the given text of characters on the element (usually an input text).
|
DOMWindow |
typeAndEnter(String content)
As the method
type(String content) , it types the given text on the element (usually an input text) and
then generates the "VK_RETURN" keypress event at the end. |
addEventListener, appendChild, compareDocumentPosition, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, getTextContent, getXPathEvaluator, insertBefore, isDescendant, isSameNode, isVisible, registerMutationObserver, removeChild, removeEventListener, replaceChild, setTextContent, toPrettyHTML
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNeighbourhood, getOuterHTML, isEnabled, js, moveToFrame, moveToHREF, observeCSSProperties
appendChild, compareDocumentPosition, executeJavaScript, getAttributes, getBrowser, getChildNodes, getDOMProperty, getFirstChild, getLastChild, getLocalName, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, getTextContent, getXPathEvaluator, getXPathLocator, insertBefore, isDescendant, isEqualNode, isSameNode, isStale, isTextNode, isVisible, registerMutationObserver, registerMutationObserver, removeChild, replaceChild, setTextContent, toPrettyHTML, toPrettyString
addEventListener, removeEventListener
protected DOMElement decoratedElement
public DOMElementDecorator(DOMElement element)
element
- public DOMElement querySelector(String selectors)
querySelector
in interface DOMNodeSelector
public DOMNodeList querySelectorAll(String selectors)
querySelectorAll
in interface DOMNodeSelector
public DOMCSSStyleDeclaration getComputedStyle()
DOMElement
getComputedStyle
in interface DOMElement
public DOMBoundingClientRect getBoundingClientRect()
DOMElement
DOMBoundingClientRect
for the element, relative to the document, i.e., taking into account window
scrollinggetBoundingClientRect
in interface DOMElement
DOMBoundingClientRect
for the elementpublic void setAttribute(String name, String value)
DOMElement
setAttribute
in interface DOMElement
name
- attribute namevalue
- the value to setpublic void removeAttribute(String name)
DOMElement
removeAttribute
in interface DOMElement
public String getAttribute(String name)
DOMElement
getAttribute
in interface DOMElement
public boolean click(boolean waitUntilLoaded)
DOMElement
click
in interface DOMElement
waitUntilLoaded
- if true, the method is performed synchronously and waits until the document at the new location (if any),
is fully loaded.public DOMWindow click()
DOMElement
click
in interface DOMElement
public DOMWindow fireMouseEvent(String event)
DOMElement
DOMMouseEvent
) on this element element and waits until the
document at the new location (if any), is fully loaded. If the event triggers opening a new window, it is returned
as result, otherwise the current window is returned. Note: this method won't generate related events, e.g., for
click it won't simulate the correct sequence, but only the click event.fireMouseEvent
in interface DOMElement
event
- (see DOMMouseEvent
)public DOMWindow fireFocusEvent(String event)
DOMElement
DOMFocusEvent
) on this element element and waits until the
document at the new location (if any), is fully loaded. If the event triggers opening a new window, it is returned
as result, otherwise the current window is returned. To simulate the user focus action, use the method
focus()
fireFocusEvent
in interface DOMElement
event
- (see DOMFocusEvent
)public DOMWindow fireKeyboardEvent(String event, char printableChar)
DOMElement
DOMKeyboardEvent
) on this element element and waits until the
document at the new location (if any), is fully loaded. If the event triggers opening a new window, it is returned
as result, otherwise the current window is returnedfireKeyboardEvent
in interface DOMElement
event
- (see DOMKeyboardEvent
)printableChar
- the char related to the key event.public DOMWindow type(String content)
DOMElement
type
in interface DOMElement
content
- the text to enterpublic DOMWindow typeAndEnter(String content)
DOMElement
type(String content)
, it types the given text on the element (usually an input text) and
then generates the "VK_RETURN" keypress event at the end. It waits until the document at the new location (if any),
is fully loaded. If the event triggers opening a new window, it is returned as result, otherwise the current window
is returnedtypeAndEnter
in interface DOMElement
content
- the text to enterpublic String getInnerHTML()
DOMElement
getInnerHTML
in interface DOMElement
public HTMLUtil htmlUtil()
DOMElement
htmlUtil
in interface DOMElement
public DOMWindow mouseover()
DOMElement
mouseover
in interface DOMElement
public DOMWindow focus()
DOMElement
focus
in interface DOMElement
public DOMWindow sendClick(float x, float y)
DOMElement
sendClick
in interface DOMElement
public DOMWindow keypress(DOMKeyboardEvent.Key content)
keypress
in interface DOMElement
Copyright © 2020 OXPath Team. All rights reserved.