博客
关于我
python-appium实现多点触控,多点操作
阅读量:280 次
发布时间:2019-03-01

本文共 1315 字,大约阅读时间需要 4 分钟。

python–appium实现多点触控,多点操作

需求:验证一个概率性问题:三指截屏后不保存的问题

难点:需要三个下滑动作同时进行

#此脚本实现三指下滑截屏import timefrom appium import webdriverfrom appium.webdriver.common.touch_action import TouchActionfrom appium.webdriver.common.multi_action import MultiActiondesired_caps = {}desired_caps['platformName'] = 'Android'      #平台名称desired_caps['deviceName'] = "aa"      #设备名称desired_caps['platformVersion'] = "9"   #平台版本desired_caps['appPackage'] = "com.google.android.apps.messaging"              #包名desired_caps['appActivity'] = "com.google.android.apps.messaging.ui.ConversationListActivity"            #包入口desired_caps['noReset'] = 'true'driver = webdriver .Remote('http://localhost:4723/wd/hub', desired_caps)  #启动服务/通过4723端口来建立一个会话def scr():    action1 = TouchAction(driver) #第一个手势    action2 = TouchAction(driver) #第二个手势    action3 = TouchAction(driver) #第三个手势    zoom_action = MultiAction(driver)    action1.press(x = 300, y = 600).move_to(x = 300, y = 750).wait(200).release()    action2.press(x = 400, y = 600).move_to(x = 400, y = 750).wait(200).release()    action3.press(x = 500, y = 600).move_to(x = 500, y = 750).wait(200).release()    zoom_action.add(action1,action2,action3)  #加载    time.sleep(2)    print("第%s次截图"%(i))    zoom_action.perform()  #执行if __name__ == '__main__':    for i in range(100):     #执行100次        scr()

转载地址:http://sino.baihongyu.com/

你可能感兴趣的文章
mysql5.7示例数据库_Linux MySQL5.7多实例数据库配置
查看>>
MySQL8.0.29启动报错Different lower_case_table_names settings for server (‘0‘) and data dictionary (‘1‘)
查看>>
MySQL8修改密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
查看>>
MySQL8找不到my.ini配置文件以及报sql_mode=only_full_group_by解决方案
查看>>
mysql8的安装与卸载
查看>>
mysqlbinlog报错unknown variable ‘default-character-set=utf8mb4‘
查看>>
mysqldump 导出中文乱码
查看>>
mysqldump备份时忽略某些表
查看>>
mysqldump实现数据备份及灾难恢复
查看>>
mysqlreport分析工具详解
查看>>
MySQL一个表A中多个字段关联了表B的ID,如何关联查询?
查看>>
MYSQL一直显示正在启动
查看>>
MySQL一站到底!华为首发MySQL进阶宝典,基础+优化+源码+架构+实战五飞
查看>>
MySQL万字总结!超详细!
查看>>
Mysql下载以及安装(新手入门,超详细)
查看>>
MySQL中B+Tree索引原理
查看>>
mysql中cast() 和convert()的用法讲解
查看>>
mysql中floor函数的作用是什么?
查看>>
MySQL中group by 与 order by 一起使用排序问题
查看>>
mysql中having的用法
查看>>