Hello,
I am trying to automate an application in which I need to click on the Imagebutton. Even if I enter valid ID, it doesn’t click it and gives me the error that element is not found.
PFA the code and mobile screenshot.
@AndroidFindBy(id = "id = "XXXXXXXXXXXXXXXX:id/img_cardadd")
private WebElement menu;
public LoginScreen clickMenu(){
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
menu.click();
return this;
}
Here is the error
org.openqa.selenium.NoSuchElementException: Can't locate an element by this strategy: Locator map: - native content: "By.id: XXXXXXXXXXXXXXX:id/img_cardadd" - html content: "by id or name "menu"" For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Here is the locators
Appium version - 1.6.4
Android OS Version - 7.1.1, Android N
Device - Nexus 5X