Skip to content
Browse files

Introducing missing __findViewWithAttributeInTreeOrRaise in order to …

…make findViewWithContentDescriptionOrRaise work.
  • Loading branch information...
1 parent 73f0fc1 commit e63e042db7f4c50f7f077bf371d247746b7f6550 @adzellman adzellman committed Feb 27, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 AndroidViewClient/src/com/dtmilano/android/viewclient.py
View
9 AndroidViewClient/src/com/dtmilano/android/viewclient.py
@@ -1611,7 +1611,14 @@ def __findViewWithAttributeInTree(self, attr, val, root):
return v
return None
-
+
+ def __findViewWithAttributeInTreeOrRaise(self, attr, val, root):
+ view = self.__findViewWithAttributeInTree(attr, val, root)
+ if view:
+ return view
+ else:
+ raise ViewNotFoundException("Couldn't find View with %s='%s' in tree with root=%s" % (attr, val, root))
+
def __findViewWithAttributeInTreeThatMatches(self, attr, regex, root, rlist=[]):
if not self.root:
print >>sys.stderr, "ERROR: no root, did you forget to call dump()?"

0 comments on commit e63e042

Please sign in to comment.
Something went wrong with that request. Please try again.