Using java-client 3 and above
Exception:-
Nov 02, 2017 12:02:34 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
java.lang.NullPointerException
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:279)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83)
at com.healthkart.hkMsiteAutomation.regression.TestApp.main(TestApp.java:34)
Code:-
AndroidDriver driver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
try
{
WebElement element = driver.findElement(By.xpath("//android.widget.ImageButton[@content-desc=‘Navigate up’]"));
element.click();
}
catch(Exception e)
{
e.printStackTrace();
}
}