Error in using UIAutomatorviewer for testing Android app in Appium


I have to automate an Android application, I am doing the same through Appium. The problem I am facing is after launching the Appium server, the app is getting installed in the emulator 4.4.2 and to inspect the element I am using UIAutomatorviewer which comes default with SDK. But while inspecting the element of the app, I am getting the error![enter image description here][1]

Error obtaining UI hierarchy
Reason:Error while obtaining UI hierarchy XML object doesn't exist.

I tried to find the solution so that I can inspect the element so that I can script, but in vain.

  1. Can someone please tell how to fix the issue so that I can inspect elements?
  2. Is there any other way I can inspect element in the app apart from using UIAutomator viewer?
  • You must to post comments

After my tryst with the uiautomator viewer i came to know that we get the error only when:

appium server is running and we try to capture the screenshot using uiautomatorviewer.

So, whenever you want to use uiautomatorviewer make sure that server is in stopped state.

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.