我正在使用
action = TouchAction(self.driver)
action.press(self.element).perform()
height = self.element.size["height"]
action.move_to(x=0, y=height*int(height_multiplier)).perform()
在 android 中滚动。但是如果我给 height_multiplier 作为 1
或 2
它工作正常。也向下滚动。但是当我给它 -1
或 -2
期望它也向上它给出错误
The coordinates provided to an interactions operation are invalid.
我已经尝试过 scroll(element1,element2)
但它不滚动,只是轻弹到结束。而且 driver.execute
的效果不如 mobile :scroll
尚未为 android 实现。有人知道解决方法吗?部分滚动正是我想要的
最佳答案
我实现了如下向上滚动:driver.swipe(0, scrollStart, 0, scrollEnd, 2000)
其中 scrollStart < scrollEnd
.两个值仍然必须为正以适合分辨率范围。
关于android - 无法向上滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36417603/