一、關于 get_attribute 方法的坑(原文:https://testerhome.com/topics/2606)
1.獲取 content-desc 的方法為 get_attribute("name"),而且還不能保證返回的一定是 content-desc (content-desc 為空時會返
回 text 屬性值)。
2.get_attribute方法不是我們在 uiautomatorviewer看到的所有屬性都能獲取的(此處的名稱均為使用 get_attribute 時使用的屬
性名稱)。
可獲取的:
字符串類型:
name(返回 content-desc 或 text)
text(返回 text)
className(返回 class,只有 API=>18 才能支持)
resourceId(返回 resource-id,只有 API=>18 才能支持)
布爾類型(如果無特殊說明, get_attribute 里面使用的屬性名稱和 uiautomatorviewer 里面的一致):
enabled
checkable
checked
clickable
focusable
focused
longClickable(返回 long-clickable)
scrollable
displayed(此元素是否在當前界面存在。調用的是 UIObject 的 exists()方法,詳情請看
http://developer.android.com/reference/android/support/test/uiautomator/UiObject.html#exists())
獲取不到,但會顯示在 uiautomatorviewer 中的屬性:
index
package
password
bounds(可通過 get_position 來獲取其中部分內容)
二、xcodebuild failure: xcodebuild failed with code 65
嘗試解決之一:
Two pieces of software are currently necessary to run iOS tests on real devices:
libimobiledevice - install using brew install libimobiledevice --HEAD
ios-deploy - install using npm install -g ios-deploy