|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectio.appium.java_client.TouchAction
public class TouchAction
Used for Webdriver 3 touch actions See the Webriver 3 spec https://dvcs.w3.org/hg/webdriver/raw-file/default/webdriver-spec.html The flow is to chain individual touch actions into an entire gesture. e.g. TouchAction action = new TouchAction(driver); action.press(element).waitAction(300).moveTo(element1).release().perform(); Calling perform() sends the action command to the Mobile Driver. Otherwise, more and more actions can be chained.
Constructor Summary | |
---|---|
TouchAction(MobileDriver driver)
|
Method Summary | |
---|---|
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(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 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 |
moveTo(int x,
int y)
Move current touch to an absolute 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TouchAction(MobileDriver driver)
Method Detail |
---|
public TouchAction press(org.openqa.selenium.WebElement el)
el
- element to press on
public TouchAction press(int x, int y)
x
- x coordinatey
- y coordinate
public TouchAction press(org.openqa.selenium.WebElement el, int x, int y)
el
- element to press onx
- x offsety
- 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
- x coordinatey
- y coordinate
public TouchAction moveTo(org.openqa.selenium.WebElement el, int x, int y)
el
- element to move current touch tox
- x offsety
- y offset
public TouchAction tap(org.openqa.selenium.WebElement el)
el
- element to tap
public TouchAction tap(int x, int y)
x
- x coordinatey
- y coordinate
public TouchAction tap(org.openqa.selenium.WebElement el, int x, int y)
el
- element to tapx
- x offsety
- 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(int x, int y)
x
- x coordinatey
- y coordinate
public TouchAction longPress(org.openqa.selenium.WebElement el, int x, int y)
el
- element to long-pressx
- x offsety
- y offset
public void cancel()
public TouchAction perform()
protected com.google.common.collect.ImmutableMap<String,com.google.common.collect.ImmutableList> getParameters()
protected void clearParameters()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |