標籤:appium
1.6起放棄uiautomation;
改用xcuiteest機制;
環境基礎:xcode8,ios9.3以上
1. 安裝最新版1.6.3
安裝cnpm: npm install -g cnpm --registry=https://registry.npm.taobao.org
安裝appium1.6.3: cnpm install -g [email protected]
2.安裝appium-xcuitest-driver依賴
進入WebDriverAgent安裝目錄:cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
運行bootstrap:
mkdir -p Resources/WebDriverAgent.bundlesh ./Scripts/bootstrap.sh -d
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 擷取當前所有裝置資訊
操作後,如所示
(一)
650) this.width=650;" src="http://note.youdao.com/yws/res/3724/WEBRESOURCEa4aac618772ae08269b9377874cd81b1" />
(二)自動在瀏覽器中開啟如二所示的介面,通過 選擇左側元素,查看它的各項屬性,name,class,xpath等。
650) this.width=650;" src="http://note.youdao.com/yws/res/3727/WEBRESOURCE7c0273bd4dbf25b05e694eb32882fbe2" />
原appium 1.5定位主要基於xpath,用name,class_name等定位效果差。
appium 1.6中用name,class_name等定位成功率高,幾乎不再用xpath。
http://www.cnblogs.com/hyddd/p/5571229.html Macaca是一個輕量級的Appium。 這個可以嘗試使用一下
(六) appium 1.6 使用與APP-inspector定位