after obfuscating the apk with dexguard ,elements resource ids are not visible in uiautomator tool.
can the dexguard release build used for automation? how to keep the elements resource ids for dexguard release build?
after obfuscating the apk with dexguard ,elements resource ids are not visible in uiautomator tool.
can the dexguard release build used for automation? how to keep the elements resource ids for dexguard release build?
-keepresources id/**
did the trick.
Yes. I have automated many applications which have few, if any resource-id's. Even those that do use resource-id's keep in mind that unlike in HTML they are not always unique - many elements can contain the same resource-id anyway.
If I am provided with a resource-id and I've examined the page elements closely and see that the id is unique, I'll often use it. Elements are often more-consistently found using XPaths, in my opinion, which allows a much more detailed locator.
More often than not, I'll do something like
"//android.widget.TextView[@text='whatever']
or further:
"//android.widget.TextView[@text='whatever' and @index=1]"