I have a method that allows me to scroll down (android and iOS) on a menu (this works for me since it's a side menu).
from appium.webdriver.common.touch_action import TouchAction
def _scroll_down_menu_settings(self, distance=400):
action = TouchAction(self.driver)
window_size = self.driver.get_window_size()
x, y = window_size['width'] / 6, window_size['height'] / 2
action.press(x=x, y=y).wait(500).move_to(x=x, y=y - distance).release().perform()
How can I perform a press (or click?) by coordinates with ActionChains
so I can perform a scroll down by customized distance?
TouchAction
class is being deprecated, and the documentation recommends to use ActionChains
. I've tried to do it with ActionChain.some_actions()
available in its class, but none of them work for me. For example: scroll_to_element()
, scroll_by_amount()
, scroll_from_origin()
since they are imported as:
from selenium.webdriver.common.action_chains import ActionChains
as opposed to using TouchActions as:
from appium.webdriver.common.touch_action import TouchAction