I have used the following code, but it is not working:
int startX = driver.findElement(By.xpath("//*[@class='android.widget.FrameLayout' and @index='1']")).getLocation.getX();
int startY = driver.findElement(By.xpath("//*[@class='android.widget.FrameLayout' and @index='1']")).getLocation.getY();
and the error I get is:
getLocation cannot be resolved or is not a field
Firstly you should try getting location as
getLocation()
instead of:.getLocation.getY()
.Secondly you can implement swipe/scroll in all directions using:
Best Tutorial to understand horizontal scroll - CLICK HERE