在运行Android API level 17的真实设备上使用appium-selendroid模式,我尝试使用以下代码向下滚动
TouchActions action = new TouchActions(driver).scroll(0,100);
action.perform();然而,滚动发生时,元素不会获得rendered.Kindly帮助来解决问题。
发布于 2014-07-01 19:38:41
解决方案-实现一个使用接口的类RemoteWebDriver公共类SwipeableWebDriver扩展RemoteWebDriver实现HasTouchScreen {公共RemoteTouchScreen触摸;
public SwipeableWebDriver(URL url, Capabilities caps) {
super(url, caps);
touch = new RemoteTouchScreen(getExecuteMethod());
}
public TouchScreen getTouch() {
return touch;
}现在实例化这个类的驱动程序,并使用问题中给出的Touch类,使用"flick“手势而不是滚动。
发布于 2015-12-02 18:22:56
我使用相同的代码,面临同样的问题,在使用flick方法之后,它为我修复了。Already answered here
不要使用scroll,只需要用flick替换它,而且你还必须用flick给出一个元素地址。
新驱动程序操作=
TouchActions(driver).flick(element_add,0,-1000,100);action.perform();
https://stackoverflow.com/questions/24203558
复制相似问题