public class TouchAction extends Object
Constructor and Description |
---|
TouchAction(MobileDriver driver) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel this action, if it was partially completed by the driver.
|
protected void |
clearParameters() |
protected com.google.common.collect.ImmutableMap<String,com.google.common.collect.ImmutableList> |
getParameters()
Get the mjsonwp parameters for this Action.
|
TouchAction |
longPress(int x,
int y)
Press and hold the at an absolute position on the screen
until the contextmenu event has fired.
|
TouchAction |
longPress(int x,
int y,
int duration)
Press and hold the at an absolute position on the screen until the
contextmenu event has fired.
|
TouchAction |
longPress(org.openqa.selenium.WebElement el)
Press and hold the at the center of an element until the contextmenu event has fired.
|
TouchAction |
longPress(org.openqa.selenium.WebElement el,
int duration)
Press and hold the at the center of an element until the contextmenu event has fired.
|
TouchAction |
longPress(org.openqa.selenium.WebElement el,
int x,
int y)
Press and hold the at an elements upper-left corner, offset by the given amount,
until the contextmenu event has fired.
|
TouchAction |
longPress(org.openqa.selenium.WebElement el,
int x,
int y,
int duration)
Press and hold the at an elements upper-left corner, offset by the
given amount, until the contextmenu event has fired.
|
TouchAction |
moveTo(int x,
int y)
Move current touch to a new position relative to the current position on
the screen.
|
TouchAction |
moveTo(org.openqa.selenium.WebElement el)
Move current touch to center of an element.
|
TouchAction |
moveTo(org.openqa.selenium.WebElement el,
int x,
int y)
Move current touch to an element, offset from upper left corner.
|
TouchAction |
perform()
Perform this chain of actions on the driver.
|
TouchAction |
press(int x,
int y)
Press on an absolute position on the screen.
|
TouchAction |
press(org.openqa.selenium.WebElement el)
Press on the center of an element.
|
TouchAction |
press(org.openqa.selenium.WebElement el,
int x,
int y)
Press on an element, offset from upper left corner by a number of pixels.
|
TouchAction |
release()
Remove the current touching implement from the screen (withdraw your touch).
|
TouchAction |
tap(int x,
int y)
Tap an absolute position on the screen.
|
TouchAction |
tap(org.openqa.selenium.WebElement el)
Tap the center of an element.
|
TouchAction |
tap(org.openqa.selenium.WebElement el,
int x,
int y)
Tap an element, offset from upper left corner.
|
TouchAction |
waitAction()
A wait action, used as a NOP in multi-chaining.
|
TouchAction |
waitAction(int ms)
Waits for specified amount of time to pass before continue to next touch action.
|
public TouchAction(MobileDriver driver)
public TouchAction press(org.openqa.selenium.WebElement el)
el
- element to press on.public TouchAction press(int x, int y)
x
- x coordinate.y
- y coordinate.public TouchAction press(org.openqa.selenium.WebElement el, int x, int y)
el
- element to press on.x
- x offset.y
- y offset.public TouchAction release()
public TouchAction moveTo(org.openqa.selenium.WebElement el)
el
- element to move to.public TouchAction moveTo(int x, int y)
x
- change in x coordinate to move through.y
- change in y coordinate to move through.public TouchAction moveTo(org.openqa.selenium.WebElement el, int x, int y)
el
- element to move current touch to.x
- x offset.y
- y offset.public TouchAction tap(org.openqa.selenium.WebElement el)
el
- element to tap.public TouchAction tap(int x, int y)
x
- x coordinate.y
- y coordinate.public TouchAction tap(org.openqa.selenium.WebElement el, int x, int y)
el
- element to tap.x
- x offset.y
- y offset.public TouchAction waitAction()
public TouchAction waitAction(int ms)
ms
- time in milliseconds to wait.public TouchAction longPress(org.openqa.selenium.WebElement el)
el
- element to long-press.public TouchAction longPress(org.openqa.selenium.WebElement el, int duration)
el
- element to long-press.duration
- of the long-press, in milliseconds.public TouchAction longPress(int x, int y)
x
- x coordinate.y
- y coordinate.public TouchAction longPress(int x, int y, int duration)
x
- x coordinate.y
- y coordinate.duration
- of the long-press, in milliseconds.public TouchAction longPress(org.openqa.selenium.WebElement el, int x, int y)
el
- element to long-press.x
- x offset.y
- y offset.public TouchAction longPress(org.openqa.selenium.WebElement el, int x, int y, int duration)
el
- element to long-press.x
- x offset.y
- y offset.duration
- of the long-press, in milliseconds.public void cancel()
public TouchAction perform()
protected com.google.common.collect.ImmutableMap<String,com.google.common.collect.ImmutableList> getParameters()
protected void clearParameters()
Copyright © 2016. All rights reserved.