I am facing org.openqa.selenium.InvalidArgumentException: java.lang.IllegalArgumentException: FindElementModel: The mandatory field ‘selector’ is not present in JSON.
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "xxx-xxx");
capabilities.setCapability("platformName", "Android");
AndroidDriver driver = new AndroidDriver(new URL("http://127.0.0.1:6790/wd/hub"), capabilities);
WebElement go = driver.findElement(By.xpath("//android.view.View[@content-desc=\"Start a Test\"]"));
go.click();
org.openqa.selenium.InvalidArgumentException: java.lang.IllegalArgumentException: FindElementModel: The mandatory field 'selector' is not present in JSON
Build info: version: '4.0.0', revision: '3a21814679'
System info: host: 'Unknown', ip: 'Unknown', os.name: 'Linux', os.arch: 'aarch64', os.version: '4.14.98-perf+', java.version: '0'
Driver info: io.appium.java_client.android.AndroidDriver
Command: [4afe1c16-2df7-48ca-961e-c06799447968, findElement {using=xpath, value=//android.view.View[@content-desc="Start a Speedtest"]}]
Capabilities {appium:alwaysMatch: {appium:deviceName: 058f8b771961, platformName: android}, appium:firstMatch: [{}]}
Session ID: 4afe1c16-2df7-48ca-961e-c06799447968
Can anyone help me, I don’t know where I am doing wrong.