android - 无法向上滚动

标签 android python python-2.7 appium

我正在使用

    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 作为 12 它工作正常。也向下滚动。但是当我给它 -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/

相关文章:

regex - 仅否定正则表达式中的特定字符串

Android:如何画圆角线?

Android Webview 客户端证书、相互身份验证、SSL over Webview

python - if 语句中无法识别来自 xml.etree.cElementTree 的类型元素

python - 是否有适用于 Python 2.2 的带有 HTTPCookieProcessor 函数的 urllib2 模块?

python - `np.histogram` 和 `plt.hist` 有什么区别?为什么这些命令不绘制相同的图形?

python - Wx Python : Status Bar Does Not Show Menu Messages

android - SqliteException 忙 iOS/Android Xamarin MVVMCross

安卓 : click link in a page within web view

python - 在 Python : sqlalchemy. exc.programminingerror 语法错误处或附近执行原始 SQL 查询时出现问题