public class DomElement extends BrowserObject
| Modifier | Constructor and Description |
|---|---|
protected |
DomElement(JtfObjectHandle handle,
Desktop desktop)
使用 JtfObjectHandle 创建新 DomElement。
|
| Modifier and Type | Method and Description |
|---|---|
void |
domClick()
使用 DOM API 调用单击。
|
void |
domClick(int button)
使用 DOM API 调用单击。
|
void |
domClick(int button,
Point pos)
使用 DOM API 调用单击。
|
void |
domDoubleClick()
使用 DOM API 调用单击。
|
void |
domDoubleClick(int button)
使用 DOM API 调用单击。
|
void |
domDoubleClick(int button,
Point pos)
使用 DOM API 调用单击。
|
void |
domDoubleClick(int button,
Point pos,
ModifierKey modifiers)
使用 DOM API 调用单击。
|
void |
domMouseMove()
使用 DOM API 调用鼠标移动。
|
void |
domMouseMove(Point pos)
使用 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)
通过指定的样式名称检索已计算的 CSS 样式。
|
Object |
getDomAttribute(String attributeName)
获取对象特定 DOM 属性的值。
|
List<String> |
getDomAttributeList()
返回适用于此元素的所有 DOM 属性的名称。
|
List<String> |
getDomAttributeList(boolean specifiedOnly)
返回适用于此元素的所有 DOM 属性的名称。
|
Rect |
getHtmlRect()
Retrieves the rectangle of a DomElement relative to the BrowserWindow in HTML pixels.
|
String |
getText()
获取 DOM 元素的可见文本。
|
void |
highlight(String foregroundColor,
String backgroundColor)
突出显示 DOM 元素。
|
void |
scrollIntoView()
滚动 DOM 元素至浏览器窗口的可见区域。
|
void |
setDomAttribute(String attributeName,
Object attributeValue)
设置对象特定 DOM 属性的值。
|
void |
unhighlight()
还原原始前景和背景颜色。
|
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 - 可确定 DomElement 的句柄desktop - 此对象所在的桌面public void domClick()
public void domClick(int button)
button - 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...public void domClick(int button,
Point pos)
button - 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos - 坐标(相对于窗口),在此单击public void domDoubleClick()
public void domDoubleClick(int button)
button - 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...public void domDoubleClick(int button,
Point pos)
button - 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos - 坐标(相对于窗口),在此单击public void domDoubleClick(int button,
Point pos,
ModifierKey modifiers)
button - 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos - 坐标(相对于窗口),在此单击modifiers - 当前未产生任何影响,但将在 Silk Test 的未来版本中删除public void domMouseMove()
public void domMouseMove(Point pos)
pos - 新位置坐标(相对于窗口)public void executeJavaScript(String code)
code - 可评估的 JavaScript 代码public void executeJavaScript(String code, String elementName)
code - 可评估的 JavaScript 代码elementName - 可用于脚本中的当前元素的可选名称,例如“alert(currentElement.tagName);”,打开消息框并显示当前元素的标记名称public String getCssStyle(String styleName)
styleName - CSS 样式名称,例如 'text-decoration'public Object getDomAttribute(String attributeName)
attributeName - 属性的名称public 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 - 属性的名称attributeValue - 应设置的值public void unhighlight()
Copyright 2009-2012 Micro Focus. All Rights Reserved.