public class MobileObject extends TestObject implements IMobileGestures, IMobileClickable, IMobileKeyable
Modifier | Constructor and Description |
---|---|
protected |
MobileObject(JtfObjectHandle handle,
Desktop desktop)
使用 JtfObjectHandle 创建新 MobileObject。
|
Modifier and Type | Method and Description |
---|---|
void |
click()
单击指定坐标上的设备。
|
void |
click(Point position)
单击指定坐标上的设备。
|
void |
drag(Point start,
Point end)
在两个指定点间执行拖动操作。
|
void |
dragTo(Point destination)
拖动此对象至相对于移动设备的指定点。
|
void |
dragToObject(MobileObject destination)
将该对象拖动至指定的目标对象。
|
String |
getText()
获取 移动对象的文本内容。
|
boolean |
isEnabled()
获取 移动对象是否已启用。
|
boolean |
isFocused()
获取 移动对象是否有焦点。
|
boolean |
isSelected()
获取 是选择还是选中移动对象。
|
void |
longClick()
多次单击指定坐标上的设备。
|
void |
longClick(Point position)
多次单击指定坐标上的设备。
|
void |
multiTouch(List<List<Point>> pointers)
使用指定指针执行多点触控操作。
|
void |
pinchIn()
执行两点手势,每个指针都朝另一个指针移动(从对象的边缘到中心)。
|
void |
pinchIn(int percent)
执行两点手势,每个指针都朝另一个指针移动(从对象的边缘到中心)。
|
void |
pinchOut()
执行两点手势,每个指针都朝与另一个指针相反的方向移动(从对象的中心到边缘)。
|
void |
pinchOut(int percent)
执行两点手势,每个指针都朝与另一个指针相反的方向移动(从对象的中心到边缘)。
|
void |
swipe(Point start,
Point end)
在两个指定点间执行滑动。
|
void |
swipe(Point start,
Point end,
int steps)
在两个指定点间执行滑动。
|
void |
swipe(Point start,
Point end,
int steps,
int delayBetweenSteps)
在两个指定点间执行滑动。
|
void |
swipeDown()
执行向下滑动。
|
void |
swipeDown(int steps)
执行向下滑动。
|
void |
swipeDown(int steps,
int delayBetweenSteps)
执行向下滑动。
|
void |
swipeLeft()
执行向左滑动。
|
void |
swipeLeft(int steps)
执行向左滑动。
|
void |
swipeLeft(int steps,
int delayBetweenSteps)
执行向左滑动。
|
void |
swipeRight()
执行向右滑动。
|
void |
swipeRight(int steps)
执行向右滑动。
|
void |
swipeRight(int steps,
int delayBetweenSteps)
执行向右滑动。
|
void |
swipeUp()
执行向上滑动。
|
void |
swipeUp(int steps)
执行向上滑动。
|
void |
swipeUp(int steps,
int delayBetweenSteps)
执行向上滑动。
|
void |
swipeWithSegments(List<Point> segments)
在两点间执行滑动。
|
void |
swipeWithSegments(List<Point> segments,
int steps)
在两点间执行滑动。
|
void |
swipeWithSegments(List<Point> segments,
int steps,
int delayBetweenSteps)
在两点间执行滑动。
|
void |
twoPointerMultiTouch(Point startPointer1,
Point endPointer1,
Point startPointer2,
Point endPointer2)
使用两个指针执行多点触控操作。
|
void |
twoPointerMultiTouch(Point startPointer1,
Point endPointer1,
Point startPointer2,
Point endPointer2,
int steps)
使用两个指针执行多点触控操作。
|
void |
twoPointerMultiTouch(Point startPointer1,
Point endPointer1,
Point startPointer2,
Point endPointer2,
int steps,
int delayBetweenSteps)
使用两个指针执行多点触控操作。
|
void |
typeKeys(String keys)
发送一组按键至对象。
|
void |
typeKeys(String keys,
int delay)
发送一组按键至对象。
|
void |
typeKeys(String keys,
int delay,
boolean ensureFocus)
发送一组按键至对象。
|
captureBitmap, 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, 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 MobileObject(JtfObjectHandle handle, Desktop desktop)
handle
- 可确定 MobileObject 的句柄desktop
- 此对象所在的桌面public void click()
click
in interface IMobileClickable
public void click(Point position)
click
in interface IMobileClickable
position
- 可单击的坐标public void drag(Point start, Point end)
drag
in interface IMobileGestures
start
- 第一个拖动操的起点end
- 第一个拖动操的终点public void dragTo(Point destination)
destination
- 相对于移动设备的拖动的目标public void dragToObject(MobileObject destination)
destination
- 拖动的目标对象public void longClick()
longClick
in interface IMobileClickable
public void longClick(Point position)
longClick
in interface IMobileClickable
position
- 可多次单击的坐标public void multiTouch(List<List<Point>> pointers)
multiTouch
in interface IMobileGestures
pointers
- 指针的列表,其中每个指针包含描述其触控路径的点列表public void pinchIn()
pinchIn
in interface IMobileGestures
public void pinchIn(int percent)
pinchIn
in interface IMobileGestures
percent
- 收缩手势的对象对角线长度的百分比public void pinchOut()
pinchOut
in interface IMobileGestures
public void pinchOut(int percent)
pinchOut
in interface IMobileGestures
percent
- 收缩手势的对象对角线长度的百分比public void swipe(Point start, Point end)
swipe
in interface IMobileGestures
start
- 滑动的开始位置end
- 滑动的结束位置public void swipe(Point start, Point end, int steps)
swipe
in interface IMobileGestures
start
- 滑动的开始位置end
- 滑动的结束位置steps
- 指定点间的步骤的数量。增加步骤的数量以增加滑动的持续时间。public void swipe(Point start, Point end, int steps, int delayBetweenSteps)
swipe
in interface IMobileGestures
start
- 滑动的开始位置end
- 滑动的结束位置steps
- 指定点间的步骤的数量。增加步骤的数量以增加滑动的持续时间。delayBetweenSteps
- public void swipeDown()
swipeDown
in interface IMobileGestures
public void swipeDown(int steps)
swipeDown
in interface IMobileGestures
steps
- 滑动的步骤的数量。增加步骤的数量以增加滑动的持续时间。public void swipeDown(int steps, int delayBetweenSteps)
swipeDown
in interface IMobileGestures
steps
- 滑动的步骤的数量。增加步骤的数量以增加滑动的持续时间。delayBetweenSteps
- public void swipeLeft()
swipeLeft
in interface IMobileGestures
public void swipeLeft(int steps)
swipeLeft
in interface IMobileGestures
steps
- 滑动的步骤的数量。增加步骤的数量以增加滑动的持续时间。public void swipeLeft(int steps, int delayBetweenSteps)
swipeLeft
in interface IMobileGestures
steps
- 滑动的步骤的数量。增加步骤的数量以增加滑动的持续时间。delayBetweenSteps
- public void swipeRight()
swipeRight
in interface IMobileGestures
public void swipeRight(int steps)
swipeRight
in interface IMobileGestures
steps
- 滑动的步骤的数量。增加步骤的数量以增加滑动的持续时间。public void swipeRight(int steps, int delayBetweenSteps)
swipeRight
in interface IMobileGestures
steps
- 滑动的步骤的数量。增加步骤的数量以增加滑动的持续时间。delayBetweenSteps
- public void swipeUp()
swipeUp
in interface IMobileGestures
public void swipeUp(int steps)
swipeUp
in interface IMobileGestures
steps
- 滑动的步骤的数量。增加步骤的数量以增加滑动的持续时间。public void swipeUp(int steps, int delayBetweenSteps)
swipeUp
in interface IMobileGestures
steps
- 滑动的步骤的数量。增加步骤的数量以增加滑动的持续时间。delayBetweenSteps
- public void swipeWithSegments(List<Point> segments)
swipeWithSegments
in interface IMobileGestures
segments
- 可滑动的点间距public void swipeWithSegments(List<Point> segments, int steps)
swipeWithSegments
in interface IMobileGestures
segments
- 可滑动的点间距steps
- 滑动的步骤的数量。增加步骤的数量以增加滑动的持续时间。public void swipeWithSegments(List<Point> segments, int steps, int delayBetweenSteps)
swipeWithSegments
in interface IMobileGestures
segments
- 可滑动的点间距steps
- 滑动的步骤的数量。增加步骤的数量以增加滑动的持续时间。delayBetweenSteps
- public void twoPointerMultiTouch(Point startPointer1, Point endPointer1, Point startPointer2, Point endPointer2)
twoPointerMultiTouch
in interface IMobileGestures
startPointer1
- 第一个指针的开始点endPointer1
- 第一个指针的结束点startPointer2
- 第二个指针的开始点endPointer2
- 第二个指针的结束点public void twoPointerMultiTouch(Point startPointer1, Point endPointer1, Point startPointer2, Point endPointer2, int steps)
twoPointerMultiTouch
in interface IMobileGestures
startPointer1
- 第一个指针的开始点endPointer1
- 第一个指针的结束点startPointer2
- 第二个指针的开始点endPointer2
- 第二个指针的结束点steps
- 指定点间的步骤的数量。增加步骤的数量以增加拖动操作的持续时间。public void twoPointerMultiTouch(Point startPointer1, Point endPointer1, Point startPointer2, Point endPointer2, int steps, int delayBetweenSteps)
twoPointerMultiTouch
in interface IMobileGestures
startPointer1
- 第一个指针的开始点endPointer1
- 第一个指针的结束点startPointer2
- 第二个指针的开始点endPointer2
- 第二个指针的结束点steps
- 指定点间的步骤的数量。增加步骤的数量以增加拖动操作的持续时间。delayBetweenSteps
- public void typeKeys(String keys)
typeKeys
in interface IMobileKeyable
keys
- 可键入的按键public void typeKeys(String keys, int delay)
typeKeys
in interface IMobileKeyable
keys
- 可键入的按键delay
- 按键之间延迟时间(毫秒)public void typeKeys(String keys, int delay, boolean ensureFocus)
typeKeys
in interface IMobileKeyable
keys
- 可键入的按键delay
- 按键之间延迟时间(毫秒)ensureFocus
- 确定是否应确保移动对象具有焦点。通过单击移动对象中间设置焦点。默认为 true
public boolean isEnabled()
public boolean isFocused()
public boolean isSelected()
public String getText()
getText
in class TestObject
Copyright 2009-2012 Micro Focus. All Rights Reserved.