public class DomElement extends BrowserObject
| Modifier | Constructor and Description |
|---|---|
protected |
DomElement(JtfObjectHandle handle,
Desktop desktop)
Creates a new DomElement with a JtfObjectHandle.
|
| Modifier and Type | Method and Description |
|---|---|
void |
domClick()
Invokes a click using the DOM API.
|
void |
domClick(int button)
Invokes a click using the DOM API.
|
void |
domClick(int button,
Point pos)
Invokes a click using the DOM API.
|
void |
domDoubleClick()
Invokes a double click using the DOM API.
|
void |
domDoubleClick(int button)
Invokes a double click using the DOM API.
|
void |
domDoubleClick(int button,
Point pos)
Invokes a double click using the DOM API.
|
void |
domDoubleClick(int button,
Point pos,
ModifierKey modifiers)
Invokes a double click using the DOM API.
|
void |
domMouseMove()
Invokes a mouse move using the DOM API.
|
void |
domMouseMove(Point pos)
Invokes a mouse move using the DOM API.
|
void |
executeJavaScript(String code)
Evaluates the given JavaScript code within the parent document's context.
|
void |
executeJavaScript(String code,
String elementName)
Evaluates the given JavaScript code within the parent document's context.
|
String |
getCssStyle(String styleName)
Retrieves the computed CSS style with the specified style name.
|
Object |
getDomAttribute(String attributeName)
Gets the value of an object specific DOM attribute.
|
List<String> |
getDomAttributeList()
Returns the names of all DOM attributes that are available for this element.
|
List<String> |
getDomAttributeList(boolean specifiedOnly)
Returns the names of all DOM attributes that are available for this element.
|
Rect |
getHtmlRect()
Retrieves the rectangle of a DomElement relative to the BrowserWindow in HTML pixels.
|
String |
getText()
Gets the visible text of a DOM element.
|
void |
highlight(String foregroundColor,
String backgroundColor)
Highlights a DOM element.
|
void |
scrollIntoView()
Scrolls the DOM element into the visible area of the browser window.
|
void |
setDomAttribute(String attributeName,
Object attributeValue)
Sets the value of an object specific DOM attribute.
|
void |
unhighlight()
Restores the original foreground and background colors.
|
click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, isVisible, mouseMove, mouseMove, pressKeys, pressKeys, pressMouse, pressMouse, pressMouse, pressMouse, releaseKeys, releaseKeys, releaseMouse, releaseMouse, releaseMouse, releaseMouse, setFocus, typeKeys, typeKeys, typeKeys, typePasswordKeys, typePasswordKeys, typePasswordKeyscaptureBitmap, captureBitmap, exists, exists, generateLocator, getChildren, getDynamicMethodList, getParent, getPropertyList, getRect, getRect, getValue, highlightObject, highlightObject, highlightObject, invokeMethods, textCapture, textCapture, textClick, textClick, textClick, textClick, textClick, textClick, textExists, textExists, textExists, textExists, textExists, textRectangle, textRectangle, textRectangle, textRectangle, textRectangle, waitForChildDisappearance, waitForChildDisappearance, waitForDisappearance, waitForDisappearance, waitForObject, waitForObject, waitForProperty, waitForPropertyequals, exists, find, find, findAll, findAll, getCustomTypeName, getDesktop, getHandle, getLocator, getProperty, getTypeName, hashCode, imageClick, imageClick, imageClick, imageClick, imageClick, imageClick, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageExists, imageExists, imageExists, imageExistsFile, imageExistsFile, imageExistsFile, imageRectangle, imageRectangle, imageRectangle, imageRectangleFile, imageRectangleFile, imageRectangleFile, invoke, preventFinalLocator, setProperty, toStringprotected DomElement(JtfObjectHandle handle, Desktop desktop)
handle - the handle that identifies the DomElementdesktop - the desktop on which this object livespublic void domClick()
public void domClick(int button)
button - the mouse button to press. Values include: 1=left, 2=right,3=center,...public void domClick(int button,
Point pos)
button - the mouse button to press. Values include: 1=left, 2=right,3=center,...pos - the coordinates (relative to the window) at which to clickpublic void domDoubleClick()
public void domDoubleClick(int button)
button - the mouse button to press. Values include: 1=left, 2=right,3=center,...public void domDoubleClick(int button,
Point pos)
button - the mouse button to press. Values include: 1=left, 2=right,3=center,...pos - the coordinates (relative to the window) at which to clickpublic void domDoubleClick(int button,
Point pos,
ModifierKey modifiers)
button - the mouse button to press. Values include: 1=left, 2=right,3=center,...pos - the coordinates (relative to the window) at which to clickmodifiers - currently has no effect, and will be removed in future versions of Silk Testpublic void domMouseMove()
public void domMouseMove(Point pos)
pos - the coordinates (relative to the window) of the new locationpublic void executeJavaScript(String code)
code - the JavaScript code to evaluatepublic void executeJavaScript(String code, String elementName)
code - the JavaScript code to evaluateelementName - an optional name for the current element that can be used in the script, such as 'alert(currentElement.tagName);' opens a message box and displays the tag name of the current element.public String getCssStyle(String styleName)
styleName - the CSS style name, for example 'text-decoration'public Object getDomAttribute(String attributeName)
attributeName - the name of the attributepublic List<String> getDomAttributeList()
public List<String> getDomAttributeList(boolean specifiedOnly)
specifiedOnly - return only attributes specified for that DOM element. Since IE9 this is always true.public Rect getHtmlRect()
public String getText()
getText in class TestObjectpublic void highlight(String foregroundColor, String backgroundColor)
foregroundColor - foreground color for highlighted DOM element. You can use any valid HTML color, for example red or #ff0000.backgroundColor - background color for highlighted DOM element. You can use any valid HTML color, for example red or #ff0000.public void scrollIntoView()
public void setDomAttribute(String attributeName, Object attributeValue)
attributeName - the name of the attributeattributeValue - the value that should be setpublic void unhighlight()
Copyright 2009-2012 Micro Focus. All Rights Reserved.