Reputation: 704
I could not select an image from the gallery app. I am automating my Android app using Appium.
Upvotes: 2
Views: 759
Reputation: 128
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);
Upvotes: 1
Reputation: 128
how are you implementing it? You can use UIAutomator to find out the xPATH or IDs to reach to the image. you can also use "tap" to select a particular image. post your existing code,
Upvotes: 1