This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
3 / 3
Jan 2019

Hi guys,
Im trying to select any picture from gallery.

Already tried these below, where i found here at forum:

driver.findElement(MobileBy.AndroidUIAutomator("new UiSelector().descriptionContains(\"img_\")")).click();

List<MobileElement> elements = (MobileElement) driver.findElementsByClassName("//android.widget.LinearLayout");
elements.get(0).click;
TouchAction(driver)).press(PointOption.point(x,y)).waitAction(WaitOptions.waitOptions(Duration.ofMillis(300))).release().perform();

but with no success.

  • created

    Jan '19
  • last reply

    Jan '19
  • 2

    replies

  • 144

    views

  • 2

    users

  • 1

    link

You could enable assistive touch in developer settings to see where the actual tap happens.

i just tried a generic id for all files and worked, it always select the first one. Thanks

driver(device,porta).findElement(MobileBy.id(“com.android.documentsui:id/icon_thumb”)).click();