public class FlexRepeater extends TestObject implements IClickable, IKeyable
Modifier | Constructor and Description |
---|---|
protected |
FlexRepeater(JtfObjectHandle handle,
Desktop desktop)
使用 JtfObjectHandle 创建新 FlexRepeater。
|
Modifier and Type | Method and Description |
---|---|
void |
click()
单击对象。
|
void |
click(int button)
单击对象。
|
void |
click(int button,
Point pos)
单击对象。
|
void |
click(int button,
Point pos,
ModifierKey modifiers)
单击对象。
|
void |
doubleClick()
双击对象上的鼠标按钮。
|
void |
doubleClick(int button)
双击对象上的鼠标按钮。
|
void |
doubleClick(int button,
Point pos)
双击对象上的鼠标按钮。
|
void |
doubleClick(int button,
Point pos,
ModifierKey modifiers)
双击对象上的鼠标按钮。
|
String |
getAutomationClassName()
获取 包含元素的自动化类名称的字符串。
|
String |
getAutomationIndex()
获取 包含元素的自动化索引的字符串。
|
String |
getAutomationName()
获取 可用作此对象的标识符的名称。
|
String |
getClassName()
获取 包含控件开发人员所分配元素的类名称的字符串。
|
List<String> |
getColumnNames()
获取 包含数据中所有列的名称的列表。
|
int |
getCount()
获取 此中继器应执行的次数。
|
int |
getFirstVisibleRow()
获取 第一个可见子级的索引。
|
String |
getId()
获取 包含元素的自动化标识符 (ID) 的字符串。
|
int |
getLastVisibleRow()
获取 最后一个可见子级的索引。
|
int |
getNumColumns()
获取 可用数据中的总列数。
|
int |
getNumRows()
获取 可用数据的总行数。
|
int |
getStartingIndex()
获取 数据提供程序中的索引,中继器在此开始创建子级。
|
List<List<String>> |
getValues(int start,
int end)
返回矩阵,其包含所有组件部分的自动化值。
|
boolean |
isRecycleChildren()
获取 此中继器是否应重新使用之前创建的子级或新建子级。
|
void |
mouseMove()
将指针移至对象中的指定位置。
|
void |
mouseMove(Point pos)
将指针移至对象中的指定位置。
|
void |
pressKeys(String keys)
按住(不松开)一组键或鼠标按钮。
|
void |
pressKeys(String keys,
boolean ensureFocus)
按住(不松开)一组键或鼠标按钮。
|
void |
pressMouse()
按住(不松开)对象上的鼠标按钮。
|
void |
pressMouse(int button)
按住(不松开)对象上的鼠标按钮。
|
void |
pressMouse(int button,
Point pos)
按住(不松开)对象上的鼠标按钮。
|
void |
pressMouse(int button,
Point pos,
ModifierKey modifiers)
按住(不松开)对象上的鼠标按钮。
|
void |
releaseKeys(String keys)
松开一组键或鼠标按钮。
|
void |
releaseKeys(String keys,
boolean ensureFocus)
松开一组键或鼠标按钮。
|
void |
releaseMouse()
松开鼠标按钮。
|
void |
releaseMouse(int button)
松开鼠标按钮。
|
void |
releaseMouse(int button,
Point pos)
松开鼠标按钮。
|
void |
releaseMouse(int button,
Point pos,
ModifierKey modifiers)
松开鼠标按钮。
|
void |
typeKeys(String keys)
发送一组按键至对象。
|
void |
typeKeys(String keys,
int delay)
发送一组按键至对象。
|
void |
typeKeys(String keys,
int delay,
boolean ensureFocus)
发送一组按键至对象。
|
void |
typePasswordKeys(String keys)
将加密的密码输入对象,例如文本字段。
|
void |
typePasswordKeys(String keys,
int delay)
将加密的密码输入对象,例如文本字段。
|
void |
typePasswordKeys(String keys,
int delay,
boolean ensureFocus)
将加密的密码输入对象,例如文本字段。
|
captureBitmap, captureBitmap, exists, exists, generateLocator, getChildren, getDynamicMethodList, getParent, getPropertyList, getRect, getRect, getText, 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, waitForProperty
equals, 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, toString
protected FlexRepeater(JtfObjectHandle handle, Desktop desktop)
handle
- 可确定 FlexRepeater 的句柄desktop
- 此对象所在的桌面public void click()
示例使用情况
例如,要单击控件中的某个位置,请键入以下内容:
control.click (MouseButton.LEFT, new Point(244, 16));
以下示例使用鼠标左键单击控件中心:
control.click ();
click
in interface IClickable
public void click(int button)
示例使用情况
例如,要单击控件中的某个位置,请键入以下内容:
control.click (MouseButton.LEFT, new Point(244, 16));
以下示例使用鼠标左键单击控件中心:
control.click ();
click
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...public void click(int button, Point pos)
示例使用情况
例如,要单击控件中的某个位置,请键入以下内容:
control.click (MouseButton.LEFT, new Point(244, 16));
以下示例使用鼠标左键单击控件中心:
control.click ();
click
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此单击public void click(int button, Point pos, ModifierKey modifiers)
示例使用情况
例如,要单击控件中的某个位置,请键入以下内容:
control.click (MouseButton.LEFT, new Point(244, 16));
以下示例使用鼠标左键单击控件中心:
control.click ();
click
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此单击modifiers
- 修饰符public void doubleClick()
doubleClick
in interface IClickable
public void doubleClick(int button)
doubleClick
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...public void doubleClick(int button, Point pos)
doubleClick
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此单击public void doubleClick(int button, Point pos, ModifierKey modifiers)
doubleClick
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此单击modifiers
- 修饰符public List<List<String>> getValues(int start, int end)
返回值是一个行数组,每个行数组是一个项目数组。
start
- 开始子级的索引。默认值为 0。end
- 结束子级的索引。默认值为 0。public void mouseMove()
mouseMove
in interface IClickable
public void mouseMove(Point pos)
mouseMove
in interface IClickable
pos
- 新位置坐标(相对于窗口)public void pressKeys(String keys)
有效按键包括:
public void pressKeys(String keys, boolean ensureFocus)
有效按键包括:
public void pressMouse()
pressMouse
in interface IClickable
public void pressMouse(int button)
pressMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...public void pressMouse(int button, Point pos)
pressMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此点按鼠标public void pressMouse(int button, Point pos, ModifierKey modifiers)
pressMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此点按鼠标modifiers
- 修饰符public void releaseKeys(String keys)
有效按键包括:
releaseKeys
in interface IKeyable
keys
- 可松开的键或鼠标按钮public void releaseKeys(String keys, boolean ensureFocus)
有效按键包括:
releaseKeys
in interface IKeyable
keys
- 可松开的键或鼠标按钮ensureFocus
- 确定控件是否一定具有按键焦点。默认为 true
public void releaseMouse()
releaseMouse
in interface IClickable
public void releaseMouse(int button)
releaseMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...public void releaseMouse(int button, Point pos)
releaseMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此松开鼠标public void releaseMouse(int button, Point pos, ModifierKey modifiers)
releaseMouse
in interface IClickable
button
- 可点按的鼠标按钮。值包括:1= 左键,2= 右键,3= 中键...pos
- 坐标(相对于对象),在此松开鼠标modifiers
- 修饰符public void typeKeys(String keys)
有效按键包括:
示例使用情况例如,以下代码通过按 Ctrl+C 复制当前所选文本至剪贴板:
window.typeKeys ("<Left Ctrl+C>");
public void typeKeys(String keys, int delay)
有效按键包括:
示例使用情况例如,以下代码通过按 Ctrl+C 复制当前所选文本至剪贴板:
window.typeKeys ("<Left Ctrl+C>");
public void typeKeys(String keys, int delay, boolean ensureFocus)
有效按键包括:
示例使用情况例如,以下代码通过按 Ctrl+C 复制当前所选文本至剪贴板:
window.typeKeys ("<Left Ctrl+C>");
public void typePasswordKeys(String keys)
如果对象支持 SetText 方法,那么在输入加密的密码前,任何现有文本都将清空。
示例使用情况
示例用法
例如,以下代码对字符串加密并将其打印到控制台:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
然后,您可以从控制台中复制加密的密码,在这种情况下是 6Fk+Bcm+GoXe3X0=
,并按照如下所示的方式使用:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- 加密密码public void typePasswordKeys(String keys, int delay)
如果对象支持 SetText 方法,那么在输入加密的密码前,任何现有文本都将清空。
示例使用情况
示例用法
例如,以下代码对字符串加密并将其打印到控制台:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
然后,您可以从控制台中复制加密的密码,在这种情况下是 6Fk+Bcm+GoXe3X0=
,并按照如下所示的方式使用:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- 加密密码delay
- 按键之间延迟时间(毫秒)public void typePasswordKeys(String keys, int delay, boolean ensureFocus)
如果对象支持 SetText 方法,那么在输入加密的密码前,任何现有文本都将清空。
示例使用情况
示例用法
例如,以下代码对字符串加密并将其打印到控制台:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
然后,您可以从控制台中复制加密的密码,在这种情况下是 6Fk+Bcm+GoXe3X0=
,并按照如下所示的方式使用:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- 加密密码delay
- 按键之间延迟时间(毫秒)ensureFocus
- 确定控件是否一定具有按键焦点。默认为 true
public String getAutomationClassName()
public String getAutomationIndex()
public String getAutomationName()
public String getClassName()
public int getCount()
public int getFirstVisibleRow()
public String getId()
public int getLastVisibleRow()
public int getNumColumns()
public int getNumRows()
public boolean isRecycleChildren()
如果为 true,则当此中继器的 dataProvider、startingIndex 或计数更改时,它将通过结合新数据重新利用现有子级。如果需要更多子级,则应创建并添加子级。如果需要更少子级,则应删除多余子级并对其进行垃圾回收。
如果为 false,则当此中继器的 dataProvider、startingIndex 或计数更改时,它将删除之前创建的子级,然后创建并添加新数据项目中的新子级。
默认情况下,此属性为 false。将它设置为 true 会提高性能,但不适用于所有情况。例如,如果之前创建的子级具有状态信息(如用户键入了文本),则在重复利用子级时不会重置此状态。
public int getStartingIndex()
Copyright 2009-2012 Micro Focus. All Rights Reserved.