19

使用 Golang 实现 appium/WebDriverAgent 的客户端库 · TesterHome

 3 years ago
source link: https://testerhome.com/topics/23502?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

自动化工具 使用 Golang 实现 appium/WebDriverAgent 的客户端库

雷系泡泡 · May 10, 2020 · Last by 雷系泡泡 replied at May 22, 2020

· 2130 hits

先感谢两位大佬在社区的文章
感谢大佬 @chenhengjie123 的文章 自动化工具 WebDriverAgent 踩坑记
项目参考大佬 @codeskybluefacebook-wda

Golang 版 WebDriverAgent 客户端库: gwda

几乎完成了 appium/WebDriverAgent 的全部命令(部分 tvOS 的因为没环境测试。。就暂时放弃了)

放一个示例代码的执行 GIF

😳其实执行速度还可以,只是 GIF 压缩感觉卡顿

%E5%9B%BE%E5%83%8F-2.gif

下面是示例代码的执行输出:

2020/05/10 00:02:00 Name: TEST’s iPhone
2020/05/10 00:02:00 IsSimulator: false
2020/05/10 00:02:00 UIKit Size (Points): 375 x 667
2020/05/10 00:02:01 UIKit Scale factor: 2
2020/05/10 00:02:01 Native Resolution (Pixels): 750 x 1334
2020/05/10 00:02:02 Status bar size: 375 x 20
2020/05/10 00:02:02 State: Plugged in, at 100%
2020/05/10 00:02:02 Level: 100%
2020/05/10 00:02:02 该 App 未运行, 开始打开 App: com.apple.Preferences
2020/05/10 00:02:04 使当前 App 退回 主屏幕, 并至少等待 3s 后(默认等待时间)再切换到前台
2020/05/10 00:02:09 当前 App 的 PID: 3616
2020/05/10 00:02:33 搜索输入框 的截图图片格式: png
2020/05/10 00:02:33 搜索输入框 的截图图片大小(像素): (594,72)
2020/05/10 00:02:37 共找到 3 个搜索结果
2020/05/10 00:02:48 当前屏幕第一个 App/文件夹 的文本内容: “自带”文件夹
2020/05/10 00:02:48 该 App/文件夹 的坐标和大小: {
"y" : 26,
"x" : 199,
"width" : 64,
"height" : 88
}
2020/05/10 00:02:57 Orientation: Device oriented vertically, home button on the bottom
2020/05/10 00:02:57 Rotation: {
"x" : 0,
"y" : 0,
"z" : 0
}

不知道有没有爱好用 Golang 的小伙伴。。

「All right reserved, any unauthorized reproduction or transfer is prohibitted」

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK