(六) appium 1.6 使用與APP-inspector定位

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。 這個能夠嘗試使用一下

相關文章
相關標籤/搜索