title: Unable to execute Isdisplayed() method in Android appium environment
body: <p>I am stuck at a very important part of my automation which i am unable to resolve.</p>
  
  <p>I wanted to execute below code which indicates that:</p>
  
  <pre><code>//if modal is displayed
  if(driver.findElement(By.xpath("//android.widget.FrameLayout[1]//android.widget.FrameLayout[1]//android.widget.FrameLayout[1]//android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]")).isDisplayed()) {
  
  //click yes
  driver.findElement(By.xpath("//android.widget.FrameLayout[1]//android.widget.FrameLayout[1]//android.widget.FrameLayout[1]//android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.Button[1]")).click();
  }
  
  else {
  
  //else click back
  driver.findElement(By.xpath("//android.view.View[1]/android.widget.LinearLayout[1]/android.view.View[1]/android.widget.ImageButton[1]")).click();
  
  }
  </code></pre>
  
  <p>The problem is that, Appium is not identifying/considering isDisplayed() method, stucks on "if" clause and starts searching for the modal and the time out occurs and it doesn't go to next step at all.</p>
  
  <p>I have also tried to use below "size" method instead of "isDisplayed", but eclipse not accepting "size" method.</p>
  
  <pre><code>if(driver.findElement(By.xpath("//android.widget.FrameLayout[1]//android.widget.FrameLayout[1]//android.widget.FrameLayout[1]//android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]")).size()&gt;0)
  </code></pre>
  
  <p><strong>Environment:</strong></p>
  
  <p>Appium version: 1.4.16</p>
  
  <p>Eclipse version: eclipse_Kelper64</p>
  
  <p>Please suggest.
  Thanks in advance</p>