How to select image from image Gallery in android

863 views
Skip to first unread message

rakesh...@tudip.com

unread,
May 28, 2014, 8:12:07 AM5/28/14
to appium-...@googlegroups.com
I am trying to get an image from image gallery using Appium and selenium webdriver. I am trying to get it using xpath by //ImageView[@id="someId"][1] and by //GridView[@id="someId"]//ImageView[@id="someId"][1]. But unable to get image from gallery. Is there another way to select image from android gallery?

Andrew Dinh

unread,
May 29, 2014, 1:48:03 PM5/29/14
to appium-...@googlegroups.com

Uiautomator cannot select the thumbnails in Gallery.  So you have to do some clever indirect calculation to figure out the coordinates of the center of the thumbnail to be selected.  Then you long-tap on that coordinates.  :)

Rakesh Ostwal

unread,
Jun 3, 2014, 7:04:05 AM6/3/14
to Andrew Dinh, appium-...@googlegroups.com
@andrew,
Thanks for your reply. Actually ImageView is shown in GridView. Can't I select Image from GridView too?


On Thu, May 29, 2014 at 11:18 PM, Andrew Dinh <trieu...@gmail.com> wrote:

Uiautomator cannot select the thumbnails in Gallery.  So you have to do some clever indirect calculation to figure out the coordinates of the center of the thumbnail to be selected.  Then you long-tap on that coordinates.  :)

--
http://appium.io
---
You received this message because you are subscribed to a topic in the Google Groups "Appium-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/appium-discuss/TTitzYcID1U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/d/optout.



--
Regards,

Rakesh Ostwal
Reply all
Reply to author
Forward
0 new messages