1

Using appium-selendroid mode on my real device running Android API level 17, I try to scroll down using the following code

TouchActions action = new TouchActions(driver).scroll(0,100);
action.perform();

The scrolling takes place however, The elements do not get rendered.Kindly help to figure out the issue.

user2220762
  • 565
  • 4
  • 16

2 Answers2

0

Solution - implement a class that uses the interface RemoteWebDriver public class SwipeableWebDriver extends RemoteWebDriver implements HasTouchScreen { public RemoteTouchScreen touch;

public SwipeableWebDriver(URL url, Capabilities caps) {
    super(url, caps);
    touch = new RemoteTouchScreen(getExecuteMethod());
}

public TouchScreen getTouch() {
    return touch;
}

Now instantiate a driver of this class and use the Touch class as given in the question with the "flick" gesture rather than scroll.

user2220762
  • 565
  • 4
  • 16
0

I was using same code and was facing same issue and after using flick method it was fixed for me. Already answered here

Don't use scroll just replace it with flick and you also have to give an element address with flick.

TouchActions action = new TouchActions(driver).flick(element_add, 0, -1000, 100); action.perform();

Himanshu Tewari
  • 313
  • 2
  • 12