appium + XCUITest + python的自动化测试
2017-03-14 本文已影响302人
樱落e_e
环境搭建:
appium 1.6.3 可参考:mac上搭建appium1.6.3
appium-python-client 可参考:appium-python-client
Sublime Text3 可参考:mac下Sublime Text3配置Python开发环境
Appium-iOS-Inspector 可参考:Appium-iOS-Inspector
入门使用:
环境全部搭建好之后
1、终端启动appium
appium -p 4723
正常开启 会看到如下画面:

2、Python脚本
真机运行基础配置:

运行你的脚本:
command + B
3、进入Appium-iOS-Inspector-master下 双击iOS Inspector.html运行
我是自己简单拖了几个控件来试:

鼠标滑过会对应显示元素details信息 可获取我们需要的id、type、Xpath等信息
4、开启我们的自动化测试脚本编写
脚本文件:



由于是小白 简单的demo暂时使用这三种方式来获取元素
5、运行你的脚本 简单的自动化测试demo完成
补充:
下载了appium-desktop 运行代码的时候总是会踢掉WebDriverAgent
所以作者还是使用cli
了解appium客户端请查阅:appium-desktop