I'm currently developping code to make android phone test automation. I have based my test engine using python and also the AndroidViewClient librairy developed by Diego Torres
I'm able to get the hierarchy of a view using the command :
device, serialno = viewclient.ViewClient.connectToDeviceOrExit()
vc = viewclient.ViewClient(device, serialno)
for id in vc.getViewIds():
attrs = vc.findViewById(id)
#print str(id) + "->" + str(attrs)
WindowTree.append(str(id) + "->" + str(attrs))
It works fine. By the way my issue is that each view got its own hierarchy. As example, Call application can have the dial pad view and call log view.
Each of this view have their own hierarchy. I was able to identify each icons/texts fields with the its corresponding id but I still not find how to get the view name ??
Any idea ?
I would be able to react depending the view I am in. If dial pad then Ids correspond to blablabla If call log view the Ids correspond to blabla
I have tried to use "vc" to get view id but it's the same if I'm in the dial pad or call log screen. In that way, I do not have any way to know if I'm in dialpad or call log view