Question

i'm working with AndroidViewClient to find EditText and Buttons to push with monkeyrunner. The problem is that AndroidViewClient isn't able to get the coordinates, in pixels, of theses views.

The results says the next:

                   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)

Is there any solution to this problem? Is it necessary the views have definite those properties?

Thanks for your help.

Was it helpful?

Solution

API level 7 was not fully supported by AndroidViewClient, but it turned out that most of the features are the same as API level 8 which is supported. A small fix solved the problems.

Give the latest AndroidViewclient version (2.3.20) a shot and you should be fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top