xpath = “//android.widget.EditText[contains(@content-desc,‘Enter name on card’)]”
or if you want to get the value then you can try
Try below will surely work -
- driver.findElementByAccessibilityId(" string value");
- xpath = ("//android.widget.EditText[@content-desc=‘login_email_input’]");
@Telmo_Cardoso I was wondering , where did you find the list of available / supported attributes ?
I have no idea
But you made me curious. I just searched a bit and I think those are defined differently according to the driver used.
For UIA2 if you look in getElementAttributeValue() method under app/src/main/java/io/appium/uiautomator2/handler/GetElementAttribute.java you find out:
Then it fallback to a call to getBoolAttribute() method under app/src/main/java/io/appium/uiautomator2/model/UiObject2Element.java where you can also find:
Will try to work with them soon
I have below attributes:
text Remember me?
I am able to get boolean attribute checked etc but not able to getAttribute(“instance”). How to get instance value?
Please help me.
- What error you get when you try to get instance value by using getAttribute method?
- Why do you even need to access instance attribute: what’s the scenario? what do you want to accomplish?
element.getAttribute(“contentDescription”) worked. But element.getAttribute(“name”) did not give the correct value. Thanks.
You probably (I hope so) using UIAutomator2, so name doesn’t work
getAttribute("name") worked for me!