Reputation: 59
I'm researching ways to do android automation running on the device, without any workstation connection.
My approach is like this, i modified monkey's source, and is able to start 3rd party app (which i don't have the source access), I can send the keystrokes to the app too. But now I'm facing another problem, i need access properties of some ui elements, for e.g. get button's text for verification purpose.
How can i get the system's (or top activity's) hierarchy from my app?
Upvotes: 3
Views: 2454
Reputation: 119
I'd start by looking at the hierarchy with this:
https://madcoda.com/2013/01/inspect-the-view-hierarchy-of-any-android-app/ https://developer.android.com/studio/profile/ddms.html
And then writing the code with the use of the Accessibility class to access it. http://www.apps4android.org/?p=3628
Upvotes: 1
Reputation: 3856
There is a way, check out Robotium here: http://code.google.com/p/robotium/ It is open source, so you should be able to check out how they do it.
You don't need access to sources of the target app.
Upvotes: 2