Skip to content
Browse files

Check for empty response trying to obtain UiAutomator dump

- Version 2.3.5
  • Loading branch information...
1 parent 6350709 commit 5450c6ebdd7a670bd89bd2518e5152fc8e954ef8 @dtmilano committed
Showing with 5 additions and 2 deletions.
  1. +5 −2 AndroidViewClient/src/com/dtmilano/android/viewclient.py
View
7 AndroidViewClient/src/com/dtmilano/android/viewclient.py
@@ -17,7 +17,7 @@
@author: diego
'''
-__version__ = '2.3.4'
+__version__ = '2.3.5'
import sys
import subprocess
@@ -1477,8 +1477,11 @@ def dump(self, windowId=-1, sleep=1):
if self.useUiAutomator:
windowDump = '/mnt/sdcard/window_dump.xml'
- if not re.search('dumped', self.device.shell('uiautomator dump %s' % windowDump)):
+ output = self.device.shell('uiautomator dump %s' % windowDump)
+ if not output:
raise RuntimeError('ERROR: Getting UIAutomator dump')
+ if not re.search('dumped', output):
+ raise RuntimeError("ERROR: UIAutomator dump doesn't containt 'dumped'")
received = self.device.shell('cat %s 2>/dev/null' % windowDump)
if received:
received = received.encode('ascii', 'ignore')

0 comments on commit 5450c6e

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