如何使用appium / python / robot-framework滚动到android native app中的页面底部?我尝试过以下方法,但不起作用 driver.execute_script(“window.scrollTo(144,1532)”) 和 driver.execute_script('mobile:scroll',{'duration':1,'startX':48,'startY':892,'endX':144,'endY':1532}) < / p>
答案 0 :(得分:0)
appium库应该有一个_touch.py文件控制滚动或“滑动”
<强> _touch.py 强>
def swipe(self, start_x, start_y, end_x, end_y, duration=1000):
"""
Swipe from one point to another point, for an optional duration.
"""
driver = self._current_application()
driver.swipe(start_x, start_y, end_x, end_y, duration)
或
def scroll(self, start_locator, end_locator):
"""
Scrolls from one element to another
Key attributes for arbitrary elements are `id` and `name`. See
`introduction` for details about locating elements.
"""
el1 = self._element_find(start_locator, True, True)
el2 = self._element_find(end_locator, True, True)
driver = self._current_application()
driver.scroll(el1, el2)