0

我正在使用 AndroidViewClient 来查找 EditText 和 Buttons 以使用 monkeyrunner 推送。问题是 AndroidViewClient 无法获取这些视图的坐标(以像素为单位)。

结果说明了下一个:

                   com.android.launcher.BubbleTextView id/0x80203 Browser (0, 0)
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:488: UserWarning: View id/0x80002 has no 'layout:mLeft' property
  warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:511: UserWarning: View id/0x80002 has no 'layout:mTop' property
  warnings.warn("View %s has no '%s' property" % (self.getId(), self.topProperty))
               com.android.launcher.BubbleTextView id/0x80002 Messaging (0, 0)
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:488: UserWarning: View id/cell3 has no 'layout:mLeft' property
  warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:511: UserWarning: View id/cell3 has no 'layout:mTop' property
  warnings.warn("View %s has no '%s' property" % (self.getId(), self.topProperty))
            com.android.launcher.CellLayout id/cell3 None (0, 0)
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:488: UserWarning: View id/drawer has no 'layout:mLeft' property
  warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:511: UserWarning: View id/drawer has no 'layout:mTop' property
  warnings.warn("View %s has no '%s' property" % (self.getId(), self.topProperty))
         android.widget.SlidingDrawer id/drawer None (0, 0)
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:488: UserWarning: View id/all_apps has no 'layout:mLeft' property
  warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:511: UserWarning: View id/all_apps has no 'layout:mTop' property
  warnings.warn("View %s has no '%s' property" % (self.getId(), self.topProperty))
            com.android.launcher.HandleView id/all_apps None (0, 0)
            com.android.launcher.AllAppsGridView id/content None (0, 0)
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:488: UserWarning: View id/name has no 'layout:mLeft' property
  warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))
/opt/santoku/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:511: UserWarning: View id/name has no 'layout:mTop' property
  warnings.warn("View %s has no '%s' property" % (self.getId(), self.topProperty))
               android.widget.TextView id/name Alarm Clock (0, 0)
               android.widget.TextView id/name API Demos (0, 0)
               android.widget.TextView id/name Browser (0, 0)
               android.widget.TextView id/name Calculator (0, 0)
               android.widget.TextView id/name Camera (0, 0)
               android.widget.TextView id/name Contacts (0, 0)
               android.widget.TextView id/name Custom Locale (0, 0)
               android.widget.TextView id/name Dev Tools (0, 0)
               android.widget.TextView id/name Email (0, 0)
               android.widget.TextView id/name Gallery (0, 0)
               android.widget.TextView id/name Gestures Builder (0, 0)
               android.widget.TextView id/name Messaging (0, 0)
               android.widget.TextView id/name Music (0, 0)
               android.widget.TextView id/name Phone (0, 0)
               android.widget.TextView id/name Settings (0, 0)
               android.widget.TextView id/name Spare Parts (0, 0)
         com.android.launcher.DeleteZone id/delete_zone None (0, 0)

这个问题有什么解决办法吗?视图是否有必要具有确定的这些属性?

谢谢你的帮助。

4

1 回答 1

0

AndroidViewClient不完全支持API 级别 7,但事实证明大多数功能与支持的API 级别 8相同。一个小修复解决了这些问题。

试一试最新的 AndroidViewclient 版本(2.3.20),应该没问题。

于 2013-06-05T17:56:48.720 回答