I'm sorry for the language, but I'll be more direct
I'm having a problem, I find the (mobile) element in a real device, I point to it and click, but it always returns the 'java.lang.NullPointerException' error message, can anyone help me? Code below
public class testCalculator {
@Test
public void teste() throws MalformedURLException{
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "DACEE6CE5DCEEQEI");
capabilities.setCapability("appPackage","com.calculator");
capabilities.setCapability("appActivity", "com.calculator.Calculator");
capabilities.setCapability("autoGrantPermissions", "true");
AndroidDriver<?> driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.context("NATIVE_APP");
driver.findElement(By.id("com.calculator:id/tips_btn")).click();
//driver.findElement(MobileBy.AndroidUIAutomator("new UiSelector().resourceId(\"com.tct.calculator:id/tips_btn\").instance(0)")).click();
driver.quit();
}
}