I could not select an image from the gallery app. I am automating my Android app using Appium.
I have launch Android photo gallery using following code from a activity.
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivity(intent);
Test code can have following implementation.
WebDriverWait wait = new WebDriverWait(driver, 30);wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("com.android.gallery:id/grid")));
driver.context("NATIVE_APP");
HashMap<String, Double> map = new HashMap<String, Double>();
map.put("x", 0.3);
map.put("y", 0.3);
(driver).executeScript("mobile: tap", map);