I am having issue to find gallery image using appium

I am trying to capture profile picture for user in my app. when try to get picture using camera it is working fine. But select picture from gallery looks difficult for me. Because all gallary picture has no text , same id… Can anyone please help to get particular image from list.

I have attached necessary screen shot here.

Hi,

You can use xpath to refer to an image like below:

//android.widget.GridView//android.widget.ImageView[1]

Hope this helps.

Thanks,
Sujata

1 Like

Wow , That is working for me. Can you please tell me how you create xpath? I really want to learn. I am attaching screenshot in that please tell me which xpath will be there to get element. so I will get exact idea for these type of all elements.

I have tried = //android.widget.LinearLayout//android.widget.ImageView[1] as xpath for below element but that is not working.

Hi,

I too tried trial and error method, used class names for necessary elements and the index is which image in the grid you want.

Thanks,
Sujata

1 Like

@iRANG_QA

Am trying to upload the image from camera but am fail, am working on hybrid app WEBVIEW
can you help me out to upload image from camera.