I have used appium 1.6.4 and android version is on 5.1 ,6.1 and 7.0
Below is my code
public boolean navigateToLoginPage(){
String strng = null;
newObj = new LogInPage();
wait = new WebDriverWait(driver,20);
wait.until(ExpectedConditions.visibilityOf(GetStarted));
GetStarted.click();
driver.manage().timeouts().implicitlyWait(5000, TimeUnit.MILLISECONDS);
if(Country.isDisplayed()){
Country.click();
wait.until(ExpectedConditions.visibilityOf(Cancel));
Cancel.click();
}
driver.manage().timeouts().implicitlyWait(4000, TimeUnit.MILLISECONDS);
MobileNumber.sendKeys("91**********");
Next.click();
driver.manage().timeouts().implicitlyWait(3000, TimeUnit.MILLISECONDS);
OK.click();// this is the problem , this sometimes works sometimes not
//i have used the alert interface but no use
//if(OK.isEnabled()){OK.click();} it returns true and I have also used .isDisplayed but no use
//When Ok button is not clicked but the code in the try block is executed //I have also used the tap functionality but no effect
try {
strng =newObj.try1();
} catch (SQLException e) {
e.printStackTrace();
}
wait.until(ExpectedConditions.visibilityOf(EnterOTP));
EnterOTP.sendKeys(strng);
Next.click();
return true;
}