Tried the login use case with appium for android native app. But button click not working. But I am getting all test passed.Tried with mobile driver also.
@BeforeClass
public static void setUp() throws MalformedURLException
{
DesiredCapabilities capabilities=new DesiredCapabilities();
capabilities.setCapability("BROWSER_NAME","Chrome");
capabilities.setCapability("VERSION","4.3");
capabilities.setCapability("deviceName","SGH-T999L");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("appPackage","org.odk.collect.android");
capabilities.setCapability("appActivity","com.fieldforce.android.activities.LoginActivity");
webDriver=new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
// webDriver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
}
@Test
public void testLogin() throws Exception
{
// webDriver.switchTo().window("NATIVE_APP");
WebDriverWait wait = new WebDriverWait(webDriver, 10);
WebElement userName= webDriver.findElement(By.id("txt_username"));
userName.sendKeys("733894");
WebElement password= webDriver.findElement(By.id("txt_password"));
password.sendKeys("Pass@123");
WebElement login_button= webDriver.findElement(By.id("org.odk.collect.android:id/btn_login"));
wait.until(ExpectedConditions.visibilityOf(login_button));
login_button.click();
}
@AfterClass
public static void tearDown()
{
webDriver.quit();
}