Locator By.name in not working in appium v 1.7.1

Hello, I’m using By.name locator to find element in my code but when i updated my appium version to 1.7.1 . Im not able to run my code using this Locator. It is depreciated in appium

Can anyone help me with alternative work arround as i do not have id for my elements and class name is same on that screen for all elements. Im stuck with this .

By.name was depreciated with Appium 1.6, the only way going forward is Accessibility ID. you can ask App developer to add id for the ui elements.

Okk Thanks.
I used MobileElement cityvalue = (MobileElement)driver.findElementByAndroidUIAutomator(“new UiSelector().text(“City”)”);
and it works for me.

1 Like