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.
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)
How to swipe from right to left
#Please include the touch screen:
#include Selenium::WebDriver::DriverExtensions::HasTouchScreen
pages = driver.find_element(:id,'vp_pages')
driver.touch.flick(pages,-100,0,:normal).perform
#import
from selenium import webdriver
from selenium.webdriver.common.touch_actions import TouchActions
# Gestures code
pages = driver.find_element_by_id("vp_pages")
touch_actions = TouchActions(driver)
touch_actions.flick_element(pages,0,-100,0).perform()
#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();
The multi touch support is currently only in the Selendroid Java Client bindings available.
TouchAction ta = new TouchActionBuilder().pointerDown().
pointerMove(x, y).pointerUp().build();
ta.perform(driver);
TouchAction finger1 = new TouchActionBuilder().pointerDown().pause(100).
pointerMove(x, y).pointerUp().build();
TouchAction finger2 = new TouchActionBuilder().pointerDown().pause(100).
pointerMove(x, y).pointerUp().build();
MultiTouchAction multiAction = new MultiTouchAction(finger1, finger2);
multiAction.perform(driver);