I am not getting option to use driver.findElementByUiAutomator

Please find the attached screenshot.

Hi,

you sure that your AndroidDriver is from io.appium.java_client.android.AndroidDriver ?

Yes AndroidDriver is coming from io.appium.java_client.android.AndroidDriver

Please find the attached screenshot.

I always used my driver as AppiumDriver. You are using as RemoteWebDriver.

Iā€™m not sure why you are using that, but if you cast it, it will work:

((AndroidDriver)driver).findElementByAndroidUIAutomator("...");

Look here also for more info on drivers:

Thanks! I will try it,

Hi,

Am also facing the same issue

please help

Hi,

As mentioned above, please make sure that you are using AndroidDriver instead of WebDriver. Even if you are using WebDriver, you can cast it to AndroidDriver

((AndroidDriver)driver).findElementByUIAutomator(ā€œā€¦ā€)

Also, please make sure that you are using the latest version of Java Client - GitHub - appium/java-client: Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol

1 Like