public interface DOMElement extends DOMNode, DOMNodeSelector
DOMNode.Type
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
|
List<DOMElement> |
getNeighbourhood(int radius)
Returns elements appearing whithin the radius of this target elements.
|
String |
getOuterHTML() |
HTMLUtil |
htmlUtil()
Returns an object that allows to cast down this element to HTML DOM specific implementations
|
boolean |
isEnabled() |
DOmElementOnJS |
js() |
DOMWindow |
keypress(DOMKeyboardEvent.Key content) |
DOMWindow |
mouseover()
Simulates a real mouseover event (mousemove and mouseover).
|
DOMWindow |
moveToFrame()
When the current
DOMElement is either IFrame of Frame, this method navigates to the enclosed page if they
have the proerty src set. |
DOMWindow |
moveToHREF()
When the current
DOMElement has the href property set, this method navigates to its specified URL. |
CSSMutationObserver |
observeCSSProperties(DOMCSS2Properties.CssProperty... properties)
Puts the given css properties under observation, in particular compares the current state with the one at the
moment
CSSMutationObserver.takeRecords() is called |
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. |
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
querySelector, querySelectorAll
CSSMutationObserver observeCSSProperties(DOMCSS2Properties.CssProperty... properties)
CSSMutationObserver.takeRecords()
is calledproperties
- CSSMutationObserver
as handle for the observed propertiesDOMCSSStyleDeclaration getComputedStyle()
DOMBoundingClientRect getBoundingClientRect()
DOMBoundingClientRect
for the element, relative to the document, i.e., taking into account window
scrollingDOMBoundingClientRect
for the elementvoid setAttribute(String name, String value)
name
- attribute namevalue
- the value to setvoid removeAttribute(String name)
name
- String getAttribute(String name)
name
- boolean click(boolean waitUntilLoaded)
waitUntilLoaded
- if true, the method is performed synchronously and waits until the document at the new location (if any),
is fully loaded.DOMWindow click()
DOMWindow fireMouseEvent(String event)
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.event
- (see DOMMouseEvent
)DOMWindow fireFocusEvent(String event)
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()
event
- (see DOMFocusEvent
)DOMWindow fireKeyboardEvent(String event, char printableChar)
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 returnedevent
- (see DOMKeyboardEvent
)printableChar
- the char related to the key event.DOMWindow type(String content)
content
- the text to enterDOMWindow typeAndEnter(String content)
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 returnedcontent
- the text to enterString getInnerHTML()
String getOuterHTML()
HTMLUtil htmlUtil()
DOMWindow mouseover()
DOMWindow focus()
boolean isEnabled()
DOMWindow sendClick(float x, float y)
x
- y
- DOMWindow keypress(DOMKeyboardEvent.Key content)
DOMWindow moveToFrame()
DOMElement
is either IFrame of Frame, this method navigates to the enclosed page if they
have the proerty src set. Throws a WebAPIRuntimeException if the element is not a IFrame or Frame, and if the src
property is not definedDOMWindow moveToHREF()
DOMElement
has the href property set, this method navigates to its specified URL. Throws a
WebAPIRuntimeException if the href property is not defined for this node.DOmElementOnJS js()
List<DOMElement> getNeighbourhood(int radius)
radius
- DOMElement
in the oder: north,north-east,east,south-east,south,south-west,west,north-westCopyright © 2020 OXPath Team. All rights reserved.