Last time I wrote a quick review of Android's new UIAutomator tool. In that review I tried to cover it as a comparison between Android's JUnit and MonkeyRunner tools which it seems to be designed to bridge. One area I left out of my review was whether it provides deep access within a webView. This question was brought up by a Google+ user in the Android Developers' post notifying us all of the release of these new tools and I figured it deserved some investigation.
My expectation was that WebViews would remain opaque to the tool since its construction of the XML of a given view hierarchy seems like an extension of Hierarchy Viewer and thus shared its limitations. My experiment was to use the Netflix app since it is a well known app and is built making very heavy use of Android's WebView. Netflix does this so that they can deliver updates to devices through a single app rather than customizing their apps for multiple screen sizes. When I first bought my Samsung Galaxy Note phone, I was reminded of some of the pitfalls of developing apps with that assumption. Sometimes assumptions prove mistaken like that. While Netflix's assumption vis a vis WebView usage proved false, mine about UIAutomator's clairvoyance into WebViews was not.
The remainder of the words in this post belong to this simple screenshot:
My expectation was that WebViews would remain opaque to the tool since its construction of the XML of a given view hierarchy seems like an extension of Hierarchy Viewer and thus shared its limitations. My experiment was to use the Netflix app since it is a well known app and is built making very heavy use of Android's WebView. Netflix does this so that they can deliver updates to devices through a single app rather than customizing their apps for multiple screen sizes. When I first bought my Samsung Galaxy Note phone, I was reminded of some of the pitfalls of developing apps with that assumption. Sometimes assumptions prove mistaken like that. While Netflix's assumption vis a vis WebView usage proved false, mine about UIAutomator's clairvoyance into WebViews was not.
The remainder of the words in this post belong to this simple screenshot:
Hi Russell Collins,
ReplyDeleteIs it possible to automate with robotium or android web driver for android web views ?
Regards,
Reddy