Not able to locate element as it does not have either resource-id & Text

Hi

I am trying to attach an attachment in whatsaap chat. But for that I need to tap on the attach icon.
But I am not able to find any resource-id or text for the same using which I can use the icon.

See the screenshot attached.

Please let me know if there is any other way to use that particular element. Using Java Selenium for scripting.

This is the icon

This is the Node details i got using UIAutomator. Using Appium inspector also I found the same. Using Appium on windows 7

Regards,
Jayabrata

You should be able to locate it using the content-desc. Thats the best choice.

If not you can go though the class (android.widget.TextView) or even XPath

1 Like

Telmo is right.

You can refer to Content Desc as below -

driver.findElement(MobileBy.AccessibilityId(“Attach”))

1 Like

using class it is tapping on some other UI as same class has been used in two UI in the screen.

using AccessibilityId it worked…

Thanks

Thanks for your help

You can use content-desc as follows

Webelement attach = driver.findElementByAccessibilityId(“Attach”)
attach.click();

1 Like