简体   繁体   中英

having problem in touchactions in appium using python

I am making a mobile automation using Python in appium but it keeps on giving me an error in scrolling down the page. Everything is working fine except the scrolling of the page.

This is the code:

actions = TouchAction(driver)
actions.scroll_from_element(element, 10, 100)
actions.scroll(10, 100)
actions.perform()

This is the error:

AttributeError: 'TouchAction' object has no attribute 'scroll_from_element'

Change TouchAction to TouchActions

from selenium import webdriver

action = webdriver.TouchActions(driver)
action.scroll_from_element(year, 0, 0).release(0, 10).perform()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM