June 2017
Intermediate to advanced
256 pages
5h 38m
English
Swipe is another commonly used gesture on a mobile device. The swipe functionality is relative to the device height and width. So, we can use the relative device height and width to implement the swipe functionality. Android Driver supports the swipe method, and we can use it:
void swipe(int startx, int starty, int endx, int endy, int duration);

Here's the code snippet for swiping from left to right:
public void swipeLeftToRight() { int height = driver.manage().window().getSize().getHeight(); int width = driver.manage().window().getSize().getWidth(); androidDriver.swipe(width/3, height/2, (width*2)/3, height/2, 100);}
Similarly, ...
Read now
Unlock full access