Appium Android: How to use Text Attribute

Hi,

I am trying to touch an element in the screen which has a unique “Text” attribute associated to it. I am not finding an option to use the same to touch the element. Is there any way to use “Text” attribute to touch or perform any validations.

Thanks.

You can find an element by the text string by using uiautomator. See this link for details:

Once you have the element, you can click it.

1 Like

@gowthamjs
you can try this:
Android = By.xpath("//[@text=’" +Name + “’]”);
iOS - By by = By.xpath("//
[@name=’" + Name + “’]”);

1 Like