title: How to clear java.lang.IndexOutOfBoundsException in selenium webdriver
body: <p>Some one help me how to clear (java.lang.IndexOutOfBoundsException) on below code</p>
  
  <pre><code>List&lt;WebElement&gt; elements = dr.findElements(By
                  .xpath("//span[@class='small-info']"));
          System.out.println("NUMBER OF ROWS IN THIS TABLE = " + elements.size());
          for (int i = 0; i &lt;= elements.size(); i++) {
              WebElement ele = elements.get(i);
              System.out.println(ele.getText());
              if (ele.getText().contains("chri@en.com")) {
                  System.out.println("PASS");
              }
          }
  </code></pre>