惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tor Project blog
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 【当耐特】
G
Google Developers Blog
J
Java Code Geeks
The Cloudflare Blog
Attack and Defense Labs
Attack and Defense Labs
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
Cisco Talos Blog
Cisco Talos Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
I
Intezer
Jina AI
Jina AI
T
Tenable Blog
P
Palo Alto Networks Blog
Project Zero
Project Zero
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
The Hacker News
The Hacker News
F
Full Disclosure
Cloudbric
Cloudbric
量子位
H
Heimdal Security Blog
K
Kaspersky official blog
有赞技术团队
有赞技术团队
罗磊的独立博客
V
Vulnerabilities – Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
阮一峰的网络日志
阮一峰的网络日志
Vercel News
Vercel News
Recent Announcements
Recent Announcements
WordPress大学
WordPress大学
GbyAI
GbyAI
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
Recorded Future
Recorded Future
Security Archives - TechRepublic
Security Archives - TechRepublic
AI
AI
Webroot Blog
Webroot Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
The Exploit Database - CXSecurity.com
Apple Machine Learning Research
Apple Machine Learning Research
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hacker News: Front Page
Latest news
Latest news

高金的博客

人机协作逆向:用 AI + Frida 打通微信 4.1.8 macOS 数据库密钥提取 情绪价值与求真:如何平衡与应对? friend_tech 第一笔交易只能买 1 个key? friend_tech 套利到底有多卷 无公网ip,无服务器实现内网穿透 植物挖矿 浏览器环境检测 加密、编码相关知识汇总 使用tensorflow识别验证码 POW与反爬虫 知乎直播弹幕抓取与解析 知乎直播套利分析 1000刀+的羊毛在等你 如何创建一个完全匿名的EOS、ETH账号 如何通过技术手段证明"我"没有去过武汉 XUNTA 季度报告 玩游戏不如CX,JUSTGAME邀请分析(内附元数据) 如何在conflux上部署合约 程序员找对象聚合平台-xunta.today EOS 1.8 bidname的漏洞分析
appium 安卓无法点击搜索框解决办法
Gao JIn · 2020-04-19 · via 高金的博客

最近在弄python控制app做一些自动化的事情

碰到很多地方需要点击搜索按钮,搜了一堆,最终找到了完美的解决办法

之前的

1
2
3
4
5
6
7
8
9
10
def enter(self):
# 参考 http://www.lemfix.com/topics/277
# 切换成搜狗输入法
os.system("adb shell ime set com.sohu.inputmethod.sogou/.SogouIME")
sleep(5)
self.driver.press_keycode(66) # 按回车
sleep(3)
os.system("adb shell ime set io.appium.settings/.UnicodeIME")
sleep(3)
print("回车输入完毕.")

但是有时候也不好用。。。完全寄托于搜狗输入法

后面找到一种官方给出的解决办法

官方文档:https://appium.readthedocs.io/en/latest/en/writing-running-appium/android/android-ime/

基本上一劳永逸了,不过记得在 点击搜索按钮之前,记得先聚焦在 输入框。

1
2
3
4
#先聚焦在输入框
driver.find_element_by_id("com.tencent.mm:id/m7").click()
#点击搜索按钮
driver.execute_script('mobile: performEditorAction', {'action': 'search'})


本文作者:高金
本文地址https://igaojin.me/2020/04/19/appium-安卓无法点击搜索框解决办法/
版权声明:转载请注明出处!

推荐文章