appium滑动

导入TouchAction
from appium.webdriver.common.touch_action import TouchAction

  # 滑动
    def test_scroll(self):
        # 获取窗口大小,返回一个字典{'width': 1080, 'height': 1920}
        size=self.driver.get_window_size()
        # 长按滑动释放
        TouchAction(self.driver).long_press(x=size['width']*0.5,y=size['height']*0.8)\
        .move_to(x=size['width']*0.5,y=size['height']*0.2)\
        .release()\
        .perform()
posted @ 2020-10-03 15:55  捷后愚生  阅读(108)  评论(0编辑  收藏  举报