I canot locate a Mobile Element using findElemen(By.tagName)

Hi,

I am trying to locate a mobile element using “driver.findElement(By.tagName(id));” but I can’t find it.
I get an error which says the the element cannot be found.
If I use the uiautomatorviewer from Android, the inspector doesn’t see the tagName property.
I discussed with the devs and they said that tagName is the only identifier which can be unique.
Can somebody help me how to proceed in this situation?

Try having them set the ‘Content-Desc’ field for the element to the name you are looking for and try that.

Hi,

Thank for your suggestion, it was very helpful for me.
I succeeded to locate the element using “findElementByAccessibilityId”, after the dev team had set up the “content-desc” for the element.
In appium if you try to locate an element by his tagName the appium will try to locate in fact by his class name.
When you use “findElementByAccessibilityId” appium it will locate the element by his content-desc.