Camera done button

Hi ,i am trying to click or tab on done button ,its not clicking on that button but there are no errors either in eclipse or appium server

Code;
MobileElement cm= driver.findElementsByClassName(“android.widget.ImageView”).get(1);
t.tap(tapOptions().withElement(element(cm))).perform();

try use find element by id but mention FULL id = “com.android.camera:id/done_button”.

tried with resource id also still same problem

check visually where tap happens. enable in developer menu show touches.

@roopesh1

Try below snippet. Here I passed the id/xpath of the element which we want to perform click and tap on it by getting the X and Y co-ordinates of the passed id/xpath using getLocation function.

Pass - id as ‘Done’ or pass - xpath as they provided in the screenshot.

public boolean tapByElementById(String id) {
try {
WebElement element = new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.id(id)));
int startX = element.getLocation().getX();
int addition = (int) (element.getSize().height * 0.5);
int endX = startX + addition;
int startY = element.getLocation().getY();
new TouchAction<>(driver).tap(PointOption.point(endX, startY)).perform();
return true;
} catch (Exception e) {
return false;
}
}