Unable to resolve findElementByAndroidUIAutomator with java client 7.3.0 version
Description
Unable to resolve findElementByAndroidUIAutomator with java client 7.3.0
Environment
- Java client build version or git revision if you use some snapshot: java client 7.3.0
- Appium server version or git revision if you use some snapshot: Appium-1.14.2
- Desktop OS/version used to run Appium if necessary: Mac OS 10.15.3
- Real device or emulator/simulator: Simulator
Code To Reproduce Issue [ Good To Have ]
package basics; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import org.openqa.selenium.remote.DesiredCapabilities; import io.appium.java_client.MobileBy; import io.appium.java_client.android.AndroidDriver; import io.appium.java_client.android.AndroidElement; import io.appium.java_client.remote.MobileCapabilityType;
public class Test { public static void main(String[] args) throws Exception { File f = new File("src/test/java"); File fs = new File(f,"ApiDemos-debug.apk");
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "Nexus 6 API 28");
cap.setCapability(MobileCapabilityType.APP, fs.getAbsolutePath());
URL url = new URL("http://127.0.0.1:4723/wd/hub");
AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(url,cap);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.findElementByAndroidUIAutomator // findElementByAndroidUIAutomator cannot be resolved or is not a field
}
}

Hi,
Any update on this. Please reply
You need to provide a parameter of UiSelector string. ex. driver.findElementByAndroidUiAutomator("new UiSelector().text("text")); or String uiSelector = "new UiSelector().text("text")"; driver.findElementByAndroidUiAutomator(uiSelector); or driver.findElement(MobileBy.(uiSelector));