1.6起放弃uiautomation;html
改用xcuiteest机制;node
环境基础:xcode8,ios9.3以上ios
1. 安装最新版1.6.3git
安装cnpm: npm install -g cnpm --registry=https://registry.npm.taobao.orggithub
安装appium1.6.3: cnpm install -g appium@1.6.3npm
2.安装appium-xcuitest-driver依赖 bootstrap
进入WebDriverAgent安装目录:cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgentxcode
运行bootstrap: 浏览器
mkdir -p Resources/WebDriverAgent.bundle sh ./Scripts/bootstrap.sh -dapp
3. 更改脚本配置:
增长这个apabilities
automationName, "XCUITest"
源文:https://testerhome.com/topics/6962
新定位工具:https://macacajs.github.io/app-inspector/cn/
App Inspector 是运行在浏览器端的移动设备 UI 查看器,使用树状态结构查看 UI 布局,而且能自动生成 XPath,方便脚本的编写和生成。
安装
$ npm install app-inspector -g (直接装会很慢,换这个命令: npm install app-inspector -g --registry=https://registry.npm.taobao.org)
使用
$ app-inspector -u YOUR-DEVICE-ID
附:用instruments -s 获取当前全部设备信息
操做后,以下图所示
(一)
(二)自动在浏览器中打开如上图二所示的界面,经过 选择左侧元素,查看它的各项属性,name,class,xpath等。
原appium 1.5定位主要基于xpath,用name,class_name等定位效果差。
appium 1.6中用name,class_name等定位成功率高,几乎再也不用xpath。
http://www.cnblogs.com/hyddd/p/5571229.html Macaca是一个轻量级的Appium。 这个能够尝试使用一下