How to scroll in Appium using python

You can get the webdriver element using whatever method you wish, then substitute that element for <webdriver object element> in the scrollTo code. Such as:

el = self.driver.find_element_by_xpath(<your_xpath>) driver.execute_script("mobile: scrollTo", {"element": el.id})

For Webview you need to switch to the Webview, then access the webview elements using Selenium code, then switch back to Nativeview before interacting with the native elements. Again, this is covered in posts above.

"You can read more details in this thread: Mobile: scrollTo fails in iOS hybrid webview "