How to scroll to the bottom of the page in android native app using appium/python/robot-framework ? I have tried the following ways but doesn't work driver.execute_script("window.scrollTo(144, 1532)") AND driver.execute_script('mobile: scroll', {'duration': 1, 'startX': 48, 'startY': 892, 'endX': 144, 'endY': 1532})
1 Answers
0
votes
the appium library should have a _touch.py file controlling scrolls or "swipes"
_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)
or
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)