Retrieve ImageView Image in Uiautomator test case

1,509 views
Skip to first unread message

Armaan

unread,
Apr 26, 2013, 2:52:14 AM4/26/13
to adt...@googlegroups.com
Is there a way to retrieve image view element's image from a uiautomator test case?

Thanks in advance.

Guang Zhu

unread,
Apr 26, 2013, 3:51:19 PM4/26/13
to adt...@googlegroups.com
Hi,

Since UI Automator tests live in a separate process from App Under Test, there's no direct way to access the image.

However, UI Automator do provide screenshot API (since API Level 17):

If you really want to achieve this, you can take a screenshot, load the PNG, and crop it per coordinates of the ImageView; however I'd expect this to be quite slow.

Thanks,
Guang Zhu



On Thu, Apr 25, 2013 at 11:52 PM, Armaan <sanch...@gmail.com> wrote:
Is there a way to retrieve image view element's image from a uiautomator test case?

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Guang Zhu
Android Test Engineering
Google Inc.

Please keep all discussions on related Google Groups, no direct emails. Thanks!

Armaan

unread,
Apr 29, 2013, 2:56:18 AM4/29/13
to adt...@googlegroups.com
Thank you Mr. Zhu. Also can you please answer some of my other questions i have posted.
Here are the links:

Mayank Maheshwari

unread,
Jul 17, 2014, 1:30:54 AM7/17/14
to adt...@googlegroups.com
Is there any API in Uiautomator which is similar to MonkeyImage SameAs API


On Friday, April 26, 2013 12:22:14 PM UTC+5:30, Armaan wrote:
Reply all
Reply to author
Forward
0 new messages