public class MobileObject extends TestObject implements IMobileGestures, IMobileClickable, IMobileKeyable
Modifier | Constructor and Description |
---|---|
protected |
MobileObject(JtfObjectHandle handle,
Desktop desktop)
Creates a new MobileObject with a JtfObjectHandle.
|
Modifier and Type | Method and Description |
---|---|
void |
click()
Clicks on the device at the specified coordinates.
|
void |
click(Point position)
Clicks on the device at the specified coordinates.
|
void |
drag(Point start,
Point end)
Performs a drag operation between the two specified points.
|
void |
dragTo(Point destination)
Drags this object to the specified point relative to the mobile device.
|
void |
dragToObject(MobileObject destination)
Drags this object to the specified destination object.
|
String |
getText()
Gets the text content of the mobile object.
|
boolean |
isEnabled()
Gets whether the mobile object is enabled.
|
boolean |
isFocused()
Gets whether the mobile object has focus.
|
boolean |
isSelected()
Gets whether the mobile object is selected or checked.
|
void |
longClick()
LongClicks on the device at the specified coordinates.
|
void |
longClick(Point position)
LongClicks on the device at the specified coordinates.
|
void |
multiTouch(List<List<Point>> pointers)
Performs a multi-touch operation with the given pointers.
|
void |
pinchIn()
Performs a two-pointer gesture, where each pointer moves toward the other, from the edges to the center of this object.
|
void |
pinchIn(int percent)
Performs a two-pointer gesture, where each pointer moves toward the other, from the edges to the center of this object.
|
void |
pinchOut()
Performs a two-pointer gesture, where each pointer moves opposite across the other, from the center out towards the edges of the this object.
|
void |
pinchOut(int percent)
Performs a two-pointer gesture, where each pointer moves opposite across the other, from the center out towards the edges of the this object.
|
void |
swipe(Point start,
Point end)
Performs a swipe between the two specified points.
|
void |
swipe(Point start,
Point end,
int steps)
Performs a swipe between the two specified points.
|
void |
swipe(Point start,
Point end,
int steps,
int delayBetweenSteps)
Performs a swipe between the two specified points.
|
void |
swipeDown()
Performs a down-swipe.
|
void |
swipeDown(int steps)
Performs a down-swipe.
|
void |
swipeDown(int steps,
int delayBetweenSteps)
Performs a down-swipe.
|
void |
swipeLeft()
Performs a left-swipe.
|
void |
swipeLeft(int steps)
Performs a left-swipe.
|
void |
swipeLeft(int steps,
int delayBetweenSteps)
Performs a left-swipe.
|
void |
swipeRight()
Performs a right-swipe.
|
void |
swipeRight(int steps)
Performs a right-swipe.
|
void |
swipeRight(int steps,
int delayBetweenSteps)
Performs a right-swipe.
|
void |
swipeUp()
Performs a up-swipe.
|
void |
swipeUp(int steps)
Performs a up-swipe.
|
void |
swipeUp(int steps,
int delayBetweenSteps)
Performs a up-swipe.
|
void |
swipeWithSegments(List<Point> segments)
Performs a swipe between the specified points.
|
void |
swipeWithSegments(List<Point> segments,
int steps)
Performs a swipe between the specified points.
|
void |
swipeWithSegments(List<Point> segments,
int steps,
int delayBetweenSteps)
Performs a swipe between the specified points.
|
void |
twoPointerMultiTouch(Point startPointer1,
Point endPointer1,
Point startPointer2,
Point endPointer2)
Performs a multi-touch operation with two pointers.
|
void |
twoPointerMultiTouch(Point startPointer1,
Point endPointer1,
Point startPointer2,
Point endPointer2,
int steps)
Performs a multi-touch operation with two pointers.
|
void |
twoPointerMultiTouch(Point startPointer1,
Point endPointer1,
Point startPointer2,
Point endPointer2,
int steps,
int delayBetweenSteps)
Performs a multi-touch operation with two pointers.
|
void |
typeKeys(String keys)
Sends a set of keystrokes to the object.
|
void |
typeKeys(String keys,
int delay)
Sends a set of keystrokes to the object.
|
void |
typeKeys(String keys,
int delay,
boolean ensureFocus)
Sends a set of keystrokes to the object.
|
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
- the handle that identifies the MobileObjectdesktop
- the desktop on which this object livespublic void click()
click
in interface IMobileClickable
public void click(Point position)
click
in interface IMobileClickable
position
- the coordinates at which to clickpublic void drag(Point start, Point end)
drag
in interface IMobileGestures
start
- the start point of the drag operationend
- the end point of the drag operationpublic void dragTo(Point destination)
destination
- the destination of the drag relative to the mobile devicepublic void dragToObject(MobileObject destination)
destination
- the destination object of the dragpublic void longClick()
longClick
in interface IMobileClickable
public void longClick(Point position)
longClick
in interface IMobileClickable
position
- the coordinates at which to long clickpublic void multiTouch(List<List<Point>> pointers)
multiTouch
in interface IMobileGestures
pointers
- a list of pointers where every pointer contains a list of points describing it's touch pathpublic void pinchIn()
pinchIn
in interface IMobileGestures
public void pinchIn(int percent)
pinchIn
in interface IMobileGestures
percent
- percentage of the object's diagonal length for the pinch gesturepublic void pinchOut()
pinchOut
in interface IMobileGestures
public void pinchOut(int percent)
pinchOut
in interface IMobileGestures
percent
- percentage of the object's diagonal length for the pinch gesturepublic void swipe(Point start, Point end)
swipe
in interface IMobileGestures
start
- the start point of the swipeend
- the end point of the swipepublic void swipe(Point start, Point end, int steps)
swipe
in interface IMobileGestures
start
- the start point of the swipeend
- the end point of the swipesteps
- the number of steps between the specified points. Increase the amount of steps to increase the duration of the swipe.public void swipe(Point start, Point end, int steps, int delayBetweenSteps)
swipe
in interface IMobileGestures
start
- the start point of the swipeend
- the end point of the swipesteps
- the number of steps between the specified points. Increase the amount of steps to increase the duration of the swipe.delayBetweenSteps
- the delay in milliseconds between swipe steps. For example, when scrolling an application with a swipe operation, it depends on the swipe speed how far the application scrolls. Typically a higher delay (e.g. 300 milliseconds) creates more reproducible results.public void swipeDown()
swipeDown
in interface IMobileGestures
public void swipeDown(int steps)
swipeDown
in interface IMobileGestures
steps
- the number of steps for the swipe. Increase the amount of steps to increase the duration of the swipe.public void swipeDown(int steps, int delayBetweenSteps)
swipeDown
in interface IMobileGestures
steps
- the number of steps for the swipe. Increase the amount of steps to increase the duration of the swipe.delayBetweenSteps
- the delay in milliseconds between swipe steps. For example, when scrolling an application with a swipe operation, it depends on the swipe speed how far the application scrolls. Typically a higher delay (e.g. 300 milliseconds) creates more reproducible results.public void swipeLeft()
swipeLeft
in interface IMobileGestures
public void swipeLeft(int steps)
swipeLeft
in interface IMobileGestures
steps
- the number of steps for the swipe. Increase the amount of steps to increase the duration of the swipe.public void swipeLeft(int steps, int delayBetweenSteps)
swipeLeft
in interface IMobileGestures
steps
- the number of steps for the swipe. Increase the amount of steps to increase the duration of the swipe.delayBetweenSteps
- the delay in milliseconds between swipe steps. For example, when scrolling an application with a swipe operation, it depends on the swipe speed how far the application scrolls. Typically a higher delay (e.g. 300 milliseconds) creates more reproducible results.public void swipeRight()
swipeRight
in interface IMobileGestures
public void swipeRight(int steps)
swipeRight
in interface IMobileGestures
steps
- the number of steps for the swipe. Increase the amount of steps to increase the duration of the swipe.public void swipeRight(int steps, int delayBetweenSteps)
swipeRight
in interface IMobileGestures
steps
- the number of steps for the swipe. Increase the amount of steps to increase the duration of the swipe.delayBetweenSteps
- the delay in milliseconds between swipe steps. For example, when scrolling an application with a swipe operation, it depends on the swipe speed how far the application scrolls. Typically a higher delay (e.g. 300 milliseconds) creates more reproducible results.public void swipeUp()
swipeUp
in interface IMobileGestures
public void swipeUp(int steps)
swipeUp
in interface IMobileGestures
steps
- the number of steps for the swipe. Increase the amount of steps to increase the duration of the swipe.public void swipeUp(int steps, int delayBetweenSteps)
swipeUp
in interface IMobileGestures
steps
- the number of steps for the swipe. Increase the amount of steps to increase the duration of the swipe.delayBetweenSteps
- the delay in milliseconds between swipe steps. For example, when scrolling an application with a swipe operation, it depends on the swipe speed how far the application scrolls. Typically a higher delay (e.g. 300 milliseconds) creates more reproducible results.public void swipeWithSegments(List<Point> segments)
swipeWithSegments
in interface IMobileGestures
segments
- the points between to swipepublic void swipeWithSegments(List<Point> segments, int steps)
swipeWithSegments
in interface IMobileGestures
segments
- the points between to swipesteps
- the number of steps for the swipe. Increase the amount of steps to increase the duration of the swipe.public void swipeWithSegments(List<Point> segments, int steps, int delayBetweenSteps)
swipeWithSegments
in interface IMobileGestures
segments
- the points between to swipesteps
- the number of steps for the swipe. Increase the amount of steps to increase the duration of the swipe.delayBetweenSteps
- the delay in milliseconds between swipe steps. For example, when scrolling an application with a swipe operation, it depends on the swipe speed how far the application scrolls. Typically a higher delay (e.g. 300 milliseconds) creates more reproducible results.public void twoPointerMultiTouch(Point startPointer1, Point endPointer1, Point startPointer2, Point endPointer2)
twoPointerMultiTouch
in interface IMobileGestures
startPointer1
- the start point of the first pointerendPointer1
- the end point of the first pointerstartPointer2
- the start point of the second pointerendPointer2
- the end point of the second pointerpublic void twoPointerMultiTouch(Point startPointer1, Point endPointer1, Point startPointer2, Point endPointer2, int steps)
twoPointerMultiTouch
in interface IMobileGestures
startPointer1
- the start point of the first pointerendPointer1
- the end point of the first pointerstartPointer2
- the start point of the second pointerendPointer2
- the end point of the second pointersteps
- the number of steps between the specified points. Increase the amount of steps to increase the duration of the drag operation.public void twoPointerMultiTouch(Point startPointer1, Point endPointer1, Point startPointer2, Point endPointer2, int steps, int delayBetweenSteps)
twoPointerMultiTouch
in interface IMobileGestures
startPointer1
- the start point of the first pointerendPointer1
- the end point of the first pointerstartPointer2
- the start point of the second pointerendPointer2
- the end point of the second pointersteps
- the number of steps between the specified points. Increase the amount of steps to increase the duration of the drag operation.delayBetweenSteps
- the delay in milliseconds between swipe steps. For example, when scrolling an application with a swipe operation, it depends on the swipe speed how far the application scrolls. Typically a higher delay (e.g. 300 milliseconds) creates more reproducible results.public void typeKeys(String keys)
typeKeys
in interface IMobileKeyable
keys
- the keystrokes to typepublic void typeKeys(String keys, int delay)
typeKeys
in interface IMobileKeyable
keys
- the keystrokes to typedelay
- the delay between keystrokes in millisecondspublic void typeKeys(String keys, int delay, boolean ensureFocus)
typeKeys
in interface IMobileKeyable
keys
- the keystrokes to typedelay
- the delay between keystrokes in millisecondsensureFocus
- determines whether it should be ensured that the mobile object actually has the focus. The focus will be set with a click in the middle of the mobile object. Defaults to 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.