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

來源:互聯網
上載者:User

標籤: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定位

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.