ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

appium(移动鼠标)

2022-08-01 09:34:13  阅读:42  来源: 互联网

标签:appium 鼠标 get swipe driver window 坐标 移动 size



# 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

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有