0

While taking a screenshot from UI Automation Viewer, getting the error--

Error obtaining UI hierarchy Reason: Unexpected error while obtaining UI hierarchy Details: java.lang.reflect.InvocationTargetException

Please note that Appium server is stopped (Application closed)

Anmol Singh
  • 1
  • 1
  • 2
  • Possible duplicate of [Error in using UIAutomatorviewer for testing Android app in Appium](https://stackoverflow.com/questions/25201743/error-in-using-uiautomatorviewer-for-testing-android-app-in-appium) – ventiseis Feb 25 '18 at 19:04
  • I checked that answer bro, its different. My appium server wasn't even started – Anmol Singh Feb 26 '18 at 05:04
  • Have you also tried the second answer of that linked question? Where the issue is related to incorrect permissions. – Chuk Ultima Feb 26 '18 at 08:25
  • @ChukUltima, tried that too, still getting the same error. In the command prompt its displayed "E/Screenshot: Unsupported protocol: 2". – Anmol Singh Feb 26 '18 at 16:18

3 Answers3

0

You cannot get the screenshot while the appium server is still running. If you're using 'cmd' press 'CTRL + C' to terminate the session. Or if you're using the desktop version of Appium, you can try stopping the the appium server by closing the application.

0

Maybe use Android Device Monitor within the latest Android Studio version instead of UI Automation Viewer

0

https://github.com/xSAVIKx/AndroidScreencast/releases/tag/v0.0.12s

Add androidscreencast-0.0.12s-executable.jar to C:\Users\xxx\AppData\Local\Android\Sdk\tools\lib

double-beep
  • 5,031
  • 17
  • 33
  • 41
T_K
  • 1