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 onpublic TouchAction press(int x, int y)
x
- x coordinatey
- y coordinatepublic TouchAction press(org.openqa.selenium.WebElement el, int x, int y)
el
- element to press onx
- x offsety
- y offsetpublic TouchAction release()
public TouchAction moveTo(org.openqa.selenium.WebElement el)
el
- element to move topublic TouchAction moveTo(int x, int y)
x
- change in x coordinate to move throughy
- change in y coordinate to move throughpublic TouchAction moveTo(org.openqa.selenium.WebElement el, int x, int y)
el
- element to move current touch tox
- x offsety
- y offsetpublic TouchAction tap(org.openqa.selenium.WebElement el)
el
- element to tappublic TouchAction tap(int x, int y)
x
- x coordinatey
- y coordinatepublic TouchAction tap(org.openqa.selenium.WebElement el, int x, int y)
el
- element to tapx
- x offsety
- y offsetpublic TouchAction waitAction()
public TouchAction waitAction(int ms)
ms
- time in milliseconds to waitpublic TouchAction longPress(org.openqa.selenium.WebElement el)
el
- element to long-presspublic TouchAction longPress(org.openqa.selenium.WebElement el, int duration)
el
- element to long-pressduration
- of the long-press, in millisecondspublic TouchAction longPress(int x, int y)
x
- x coordinatey
- y coordinatepublic TouchAction longPress(int x, int y, int duration)
x
- x coordinatey
- y coordinateduration
- of the long-press, in millisecondspublic TouchAction longPress(org.openqa.selenium.WebElement el, int x, int y)
el
- element to long-pressx
- x offsety
- y offsetpublic TouchAction longPress(org.openqa.selenium.WebElement el, int x, int y, int duration)
el
- element to long-pressx
- x offsety
- y offsetduration
- of the long-press, in millisecondspublic 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.