Locating Android App Elements Using UI Automator Viewer

In previous post service nosotros learnt how to enable developer pick together with USB debugging trend inwards android device to connect android device amongst PC. So adjacent steps is to larn element locators for android software app. Before learning about UI Automator Viewer, You must knows why nosotros require it. To automate android software app using appium, You should aware about how to locate elements of android app to job them inwards webdriver automation software exam scripts. Let's endeavor to empathize how tin nosotros locate elements of android app.

As y'all knows, We are going to automate native android apps thus it is non possible to inspect them using fire-bug together with fire-path which nosotros tin job to locate elements of software spider web application equally described inwards THIS POST. So hither nosotros require to job another tool which tin locate elements of android app.

What Is UI Automator Viewer?
UI Automator Viewer is a tool provided yesteryear android SDK. You tin persuasion THIS POST to know how to download together with install android SDK inwards windows. UI Automator Viewer will render y'all an user interface to scan together with analyse UI components of android software application. Using UI Automator Viewer, We tin inspect the android app component hierarchy, Inspect properties of android app components together with and thus nosotros tin job those element's properties to practise xpath of chemical element together with job them inwards automation exam scripts.

You volition detect uiautomatorviewer.bat file inwards tools folder of SDK. e.g. E:\SDK\tools.

PREREQUISITES : All PREVIOUS 8 STEPS of android surroundings configuration should live on performed.

Inspecting App's UI Element Using UI Automator Viewer
We volition job default together with unproblematic reckoner app of android band to larn how to inspect its's UI elements using UI Automator Viewer tool. Follow the steps given bellow.
  • Connect your android device amongst PC (USB debugging trend should live on enabled) equally described inwards THIS POST.
  • Run ascendance "adb devices" inwards ascendance prompt to verify device is connected properly amongst PC.
  • Run uiautomatorviewer.bat file from E:\SDK\tools folder. View THIS POST to know to a greater extent than virtually SDK folder. It volition open UI Automator Viewer tool's UI equally bellow.
  • Open Calculator application inwards your android phone. You tin download Android Calculator App from THIS PAGE if it is non available amongst you.
  • In UI Automator Viewer software tool, Click on Device Screenshot picture push equally shown inwards bellow image. (Before clicking on push delight brand certain Calculator app is opened upwards inwards your android band together with it is inwards active mode. Means band is unlocked together with y'all are able to see Calculator app on screen).
  • It volition procedure to capture device screenshot.
  • After capturing screenshot of android band screen, It volition exhibit your android phone's calculator's UI in UI Automator Viewer equally bellow. 
  1. On left site it volition exhibit you calculator app's screenshot which is opened upwards inwards android device.
  2. Right side overstep job volition exhibit reckoner app's UI element's hierarchy view. It volition display node construction to explicate how elements are arranged.
  3. Right side bottom job volition exhibit belongings item of selected element.


  • In reckoner screenshot (which is display in UI Automator Viewer), Select push v to persuasion it's dissimilar properties equally shown inwards bellow image.

  • It is showing dissimilar properties of push v inwards correct side node item department which nosotros tin job to locate it using dissimilar chemical element locating strategy. 
This agency y'all tin inspect whatever chemical element of android native app using UI Automator Viewer software tool. You only require to click on chemical element together with it volition exhibit y'all that element's relative belongings detail.NEXT POST volition exhibit y'all dissimilar ways(XPath, id, className) to locate android app elements.

More interesting articles here :Generation Enggelmundus Internet Marketing Tool here :Zeageat IM http://www.software-testing-tutorials-automation.com/
Post a Comment (0)
Previous Post Next Post