title: Appium can not find any element
body: <p>I'm have on automation project(java, appium, android)
  In this project, the elements are stored in the database.
  I get elements from database and try to find it:</p>
  
  <p>1) Locator search using findElements:</p>
  
  <pre><code>if (!elementPath.equals("")){
      List elementFound = driverCommands.findElements(By.xpath(elementPath));
          if (elementFound.size() == 0){
              return null;
          }
          return (AndroidElement) elementFound.get(0);
  }
  </code></pre>
  
  <p>2) Locator search using findElement:</p>
  
  <pre><code>String elementPath = entity.getElementPath();
  driverCommands.findElement(By.xpath(elementPath));
  </code></pre>
  
  <p>In both cases I get nothing. But if I add <code>sleep()</code> before usage findElemen(s) with a wait of at least 4 seconds, as shown in the example below, then the element will be found.</p>
  
  <pre><code>try {
      Thread.sleep(4000);
  } catch (InterruptedException e) {
       e.printStackTrace();
  }
  if (!elementPath.equals("")){
      List elementFound = driverCommands.findElements(By.xpath((elementPath));
          if (elementFound.size() == 0){
              return null;
          }
          return (AndroidElement) elementFound.get(0);
  </code></pre>
  
  <p>How can I solve this problem?</p>