Mobile Gestures
Selendroid is implementing the Advanced User Interactions API. This is a new, more comprehensive API for describing actions a user can perform on an app. This includes actions such as drag and drop or clicking multiple elements while holding down the Control key.
Supported Interactions
-
doubleTap(WebElement onElement)
-
down(int x, int y)
-
flick(int xSpeed, int ySpeed)
-
flick(WebElement onElement, int xOffset, int yOffset, int speed)
-
longPress(WebElement onElement)
-
move(int x, int y)
-
singleTap(WebElement onElement)
-
up(int x, int y)
Example
How to swipe from right to left
Java:
#Please import:Β org.openqa.selenium.interactions.touch.TouchActions
WebElement pages = driver.findElement(By.id("vp_pages")); TouchActions flick = new TouchActions(driver).flick(pages, -100, 0, 0); flick.perform();