V.Agarwal
V.Agarwal

Reputation: 15

How to find element in appium using text?

I want to click on a button on a website. Is there a code which can allow me to click on the element by using the TEXT field? I can neither use the resource id field nor name as they are empty. I tried to click on the element using the xpath but that did not work.

Upvotes: 1

Views: 7826

Answers (1)

Vault23
Vault23

Reputation: 753

this is example using Java, but i believe that it is pretty easy to migrate it to a Python. You need to use AndroidUiAutomator:

androidDriver.findElementByAndroidUIAutomator("new UiSelector().text(\"your_text\")").click();

Upvotes: 1

Related Questions