Appium Inspector 定位元素

继承自webdriver的方法,也就是通过这3个特征可以定位控件

  • find by "class" (i.e., ui component type,andorid上可以是android.widget.TextView)
  • find by "xpath" (i.e., an abstract representation of a path to an element, with certain constraints,由于appium的xpath库不完备的原因,这个不太推荐)
  • find by "id"(android上是控件的resource id)

Mobile JSON Wire Protocol 协议中定义的方法,更适合移动设备上的控件定位

  • -ios uiautomation: a string corresponding to a recursive element search using the UIAutomation library (iOS-only)
  • -android uiautomator: a string corresponding to a recursive element search using the UiAutomator Api (Android-only)
  • accessibility id: a string corresponding to a recursive element search using the Id/Name that the native Accessibility options utilize.

在appium 的client对Mobile JSON Wire Protocol中定义的方法进行了封装,使其调用起来更加方便。

总的来说就是在driver里增加了

  • find_element_by_accessibility_id
  • find_elements_by_accessibility_id
  • find_element_by_android_uiautomator
  • find_elements_by_android_uiautomator

二:链接:http://blog.sina.com.cn/s/blog_68f262210102v536.html

posted @ 2015-06-17 14:45  Mytesting  Views(601)  Comments(0Edit  收藏  举报