python+appium 实现qq聊天的消息,滑动删除聊天消息
2024-08-24 14:34:37
有人问我,appium怎么去删除qq聊天的,
当时想到的是滑动,
可是具体的大概有个思路,于是乎,就想自己来实现下,
打开模拟器,开发者选项,找到显示坐标的
然后去打开qq获取要删除的消息的坐标后,
思路是y不变。x变化。
用到api TouchAction
整个代码是:
from appium import webdriver
import time
from appium.webdriver.common.touch_action import TouchAction
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['deviceName'] = '127.0.0.1:62001'
desired_caps['preformVersion'] = '4.4.2'
desired_caps['appPackage'] = 'com.tencent.mobileqq'
desired_caps['appActivity'] = '.activity.SplashActivity'
driver = webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
time.sleep(10)
TouchAction(driver).press(x=250,y=235).wait(1000).move_to(x=5,y=235).release().perform()
time.sleep(6)
driver.find_element_by_xpath('//android.view.View[@content-desc=\"删除\"]').click()
实现效果:
这就实现了 appium操作qq,实现滑动删除消息。
关注公众号,不定期更新。
github 地址:https://github.com/liwanlei . qq群:python|测试|技术交流群 194704520
python测试开发交流群 683894834
python接口测试群:651392041
腾讯视频:http://v.qq.com/vplus/6797e52f56a39105a0b6c87bb849e22c/videos
最新文章
- [iOS-UI]给输入框添加清除按钮的代码
- 2014 Super Training #7 E Calculate the Function --矩阵+线段树
- 【SPOJ】1825. Free tour II(点分治)
- Linux 下多核CPU知识【转】
- ubuntu 永久设置dns信息
- Linux源代码情景分析读书笔记 物理页面的分配
- 了解Git
- (五)u-boot2013.01.01 for TQ210:《移植前的准备及u-boot初编译》
- AJP协议总结与分析
- 从P1到P7——我在淘宝这7年(转)
- 【转】svn cleanup failed–previous operation has not finished; run cleanup if it was interrupted
- java的热部署和热加载
- python_IO编程
- UVA - 10723 类似LCS
- linux磁盘满了的处理
- 20190321-HTML基本结构
- iris数据集(鸢尾花)
- 数据格式XML、JSON详解
- Linux安装-kickstart无人值守安装
- 从浏览器中输入URL到页面加载的发生了什么-转载
热门文章
- scrapy爬虫框架之Xpath选择器
- 12-5 张雨RTCM3数据解码解不出的原因
- Alpha 冲刺报告
- 【Alpha】Daily Scrum Meeting
- spring中MessageSource的配置使用方法3--ResourceBundleMessageSource【转】
- iptables.md
- iOS 开源库系列 Aspects核心源码分析---面向切面编程之疯狂的 Aspects
- 翻新并行程序设计的认知整理版(state of the art parallel)
- CentOs7.2编译安装Nginx服务器
- BZOJ3160:万径人踪灭(FFT,Manacher)