其他分享
首页 > 其他分享> > appium(移动鼠标)

appium(移动鼠标)

作者:互联网


# coding:utf-8
__author__ = 'Helen'
'''
description:手势操作
# start_x:开始坐标 x 轴
# start_y:开始坐标 y 轴
# end_x:结束坐标 x 轴
# end_y:结束坐标 y 轴
# duration:开始坐标移动到结束坐标的时间,默认 None
'''
class gesture_mainpulation:
def swipe_left(self,driver):
'''左滑'''
x = driver.get_window_size()['width']
y = driver.get_window_size()['height']
driver.swipe(x*3/4,y/4,x/4,y/4)

def swipe_right(self,driver):
'''右滑'''
x = driver.get_window_size()['width']
y = driver.get_window_size()['height']
driver.swipe(x/4,y/4,x*3/4,y/4)

def swipe_down(self,driver):
'''下滑'''
x = driver.get_window_size()['width']
y = driver.get_window_size()['height']
driver.swipe(x/2,y*3/4,x/2,y/4)

def swipe_up(self,driver):
'''上滑'''
x = driver.get_window_size()['width']
y = driver.get_window_size()['height']
driver.swipe(x/2,y/4,x/2,y*3/4)

标签:appium,鼠标,get,swipe,driver,window,坐标,移动,size
来源: https://www.cnblogs.com/IceSparks/p/16538971.html