How to find mobile app object attributes using android studio – uiautomatorviewer

How to find mobile app object attributes using android studio – uiautomatorviewer
Like Tweet Pin it Share Share Email

When you are in the process of writing selenium webdriver code to automate any mobile app for testing it, one of the major aspect is to identify the object attributes and it values, as these details are required to form the xpath or to find the elements in the mobile app through automation code. So in this article you will know how to identify object attributes using Android Studio’s uiautomatorviewer batch file.

Android studio comes with a very beautiful tool called UI Automator Viewer present at location C:\Users\{user}\AppData\Local\Android\sdk\tools folder i.e. <sdk folder>\tools folder. 

Now let us see the simple steps to identify objects, attributes and their values

  • Double click on uiautomatorviewer batch file
  • Wait for the UI Automator Viewer window to open
  • Assuming that your mobile emulator is already open, navigate to the mobile app you want to test automate and be at the screen where you want to identify the objects and their attributes.
  • Now go back to the UI Automator Viewer and click on the left most mobile icon, which is called “Device Screenshot”
  • After sometime you would see that the screen shot of the mobile app appears in the UI Automator Viewer window.
  • Now click on any object in the screenshot and you can see its attributes and values in the right side section of UI Automator Viewer.
  • You can see attributes like resource-id, class, text, etc..

I didn’t know that it was so simple to find out,  what do you think?

Request you to share any of your queries in form of comments, we would try our best to provide you a solution.

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *