title: Timed out after 30 seconds waiting for presence of element located by: By.id:
body: <p>I tried to execute a testcase for login page in <strong>flipkart</strong> application on android device using appium. </p>
  
  <p>I am getting inconsistent error as follows:</p>
  
  <blockquote>
    <p>Timed out after 30 seconds waiting for presence of element located by:
    By.id: com.flipkart.android:id/et_password.</p>
  </blockquote>
  
  <p><strong>Note:</strong> I have used <code>implicit wait</code> and <code>explicit wait</code> and I have given <strong>time duration from 30 to 70 seconds</strong>. The test is getting passed occasionally.
  Please provide me a solution for this</p>
  
  <p>My code:</p>
  
  <pre><code>cab.setCapability(CapabilityType.VERSION, "5.1.1");
  cab.setCapability(CapabilityType.PLATFORM, "Mac");
  cab.setCapability("platformName", "android");
  cab.setCapability("platformVersion", "5.1.1");
  cab.setCapability("deviceName", "70af41a");
  cab.setCapability("app", "/Users/xxx/Downloads/flipkart.apk");
  cab.setCapability("appPackage", "com.flipkart.android"); //Replace with your app's package
  cab.setCapability("appActivity", ".SplashActivity"); //Replace with app's Activity
  driver = new AndroidDriver&lt;MobileElement&gt;(new URL("http://127.0.0.1:4723/wd/hub"), cab);
  
  driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
  
  element = driver.findElement(By.id("com.flipkart.android:id/mobileNo"));
  element.sendKeys("1234567897");
  
  //driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);;
  
  MobileElement signup = driver.findElement(By.id("com.flipkart.android:id/btn_msignup"));
  signup.click();
  WebDriverWait waitforsignup = new WebDriverWait(driver, 30);
  waitforsignup.until(ExpectedConditions.presenceOfElementLocated(By.id("com.flipkart.android:id/et_password"))); 
  //driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  </code></pre>