Android native app: Find element by ID

Hi,

I am able to find Android app ID’s by using Appium inspector but when try to use that ID’s in application, it gives me “Can’t find element” error. Any pointers will be helpful

1 Like

Could you post some code, and a screenshot of the inspector? Alternatively, you can try using the UI Automator Viewer, which might give different results.

Also, I sometimes get this problem, and I work around it by finding a parent element and digging deeper to find the child node that you want.

Can anyone share why this happens?

Hi @daren_sin,

UI Automator Viewer is returning same ID as Appium inspector. Still appium is unable to find it programmatically.

Code snippet:
driver.findElement(By.id("<package_name>id/edt_activity_signin_email")).click();

as a quick can try by giving 5 seconds wait before to the click

I would probably try to find a parent element and dig deeper to find the child element that you want. Else, as what @kumarsiva said, you can put some kind of delay for the element to be clickable.