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.
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.
Founder of TestingTools.co, constantly shares knowledge on different test automation tools. Has experience in building proof of concepts, solutions, frameworks, platforms & implementation of test automation projects.
In pursuit of building a platform with inbuilt framework and reusable components for Oracle Cloud applications ( Oracle HCM, CX, SCM, Financials clouds, Salesforce and other cloud applications )
Major accomplishments in his career:
Product architect and development manager for test automation platforms
Oracle Flow Builder @ Oracle
CloudTestr @ Suneratech
2 times to oracle open world
More than 20 successful POCs ( Proof of concepts )
Designed pricing models.
Trained more than 50 members.
Built more than 100 re-usable functions.
Worked with tools: