title: How to find element in appium
body: <p>I am new to appium. </p>
  
  <p>I am learning appium with automation of shopping app <strong>(Flipkart)</strong>. </p>
  
  <p>I am trying to select element <strong>5th element</strong> from <strong>"Recommended discount for You"</strong> list. </p>
  
  <p>In order to do that I have to make horizontal scroll to reach out to that element. But I am having problem get that container element in which elements of <strong>"Recommended discount for You"</strong> is present so I can fetch the <code>5th element</code>.</p>
  
  <p>I guess the problem is <strong>UI of flipkart</strong> always getting change. </p>
  
  <pre><code>   driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
     Thread.sleep(3000);
     driver.scrollToExact("Recommended Offers for You");
     Thread.sleep(10000);
     // Getting error on below line
     AndroidElement ele = (AndroidElement) driver.findElement(By.xpath("//android.support.v7.widget.RecyclerView[@index='1']"));
  
    for(int i=0;i&lt;4;i++)
     {
     Thread.sleep(2000);
     if (ele.findElement(By.xpath("android.widget.RelativeLayout[@index='2']")).isDisplayed())
     {
         ele.findElement(By.xpath("android.widget.RelativeLayout[@index='2']")).click();
         break;
     }
     else
     {
         horizontalScroll(ele);
     }
  
     }
  
  public void horizontalScroll(AndroidElement ele)
  {
    Dimension size=driver.manage().window().getSize();
    int x_start=(int)(size.width*0.60);
    int x_end=(int)(size.width*0.30);
    int y=130;
    ele.swipe(SwipeElementDirection.RIGHT,x_end,y,4000);
  }
  </code></pre>
  
  <p>I am using <code>uiautomator</code> to <code>find elements</code>. Here is the <strong>screenshot of UI</strong>.</p>
  
  <p><a href="https://i.stack.imgur.com/48c6W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/48c6W.png" alt="enter image description here"></a></p>
  
  <p>I have following questions:</p>
  
  <ol>
  <li>What is best way to find elements if UI of app is as displayed.</li>
  <li>Which app should I automate in order to learn appium. </li>
  <li>How to automate app if UI of app is always getting change</li>
  </ol>
  
  <p><strong>Please Help! Thanks in advance.</strong></p>