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

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
量子位
博客园_首页
Vercel News
Vercel News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Forbes - Security
Forbes - Security
IT之家
IT之家
N
News and Events Feed by Topic
S
Security Affairs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Webroot Blog
Webroot Blog
Recorded Future
Recorded Future
L
LangChain Blog
Y
Y Combinator Blog
AI
AI
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Know Your Adversary
Know Your Adversary
AWS News Blog
AWS News Blog
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
L
Lohrmann on Cybersecurity
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google Online Security Blog
Google Online Security Blog
V2EX - 技术
V2EX - 技术
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
PCI Perspectives
PCI Perspectives
I
Intezer
T
Tenable Blog
G
Google Developers Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
云风的 BLOG
云风的 BLOG
C
CXSECURITY Database RSS Feed - CXSecurity.com
有赞技术团队
有赞技术团队
O
OpenAI News
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
C
Check Point Blog
Last Week in AI
Last Week in AI
S
Schneier on Security
Simon Willison's Weblog
Simon Willison's Weblog
Blog — PlanetScale
Blog — PlanetScale

高金的博客

人机协作逆向:用 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-安卓无法点击搜索框解决办法/
版权声明:转载请注明出处!

推荐文章