title: WebDriver filtering list of elements
body: <p>how to efficiently find and filter list of elements.
  here is the HTML</p>
  
  <pre><code>&lt;span class="tab-strip-text" unselectable="on"&gt;Admin&lt;/span&gt;
  &lt;span class="tab-strip-text" unselectable="on"&gt;User&lt;/span&gt;
  &lt;span class="tab-strip-text" unselectable="on"&gt;Reports&lt;/span&gt;
  &lt;span class="tab-strip-text" unselectable="on"&gt;Logs&lt;/span&gt;
  </code></pre>
  
  <p>currently i am using following method to find and filter and click on the element i want based on text</p>
  
  <pre><code>public static void clickTab(String tabText){
    List&lt;WebElement&gt; tabs = driver.findElements(By.className("tab-strip-text"));      
      for(WebElement tab : tabs){
          if(tab.getText().equals(tabText)){
              tab.click();
              break;
          }
      }       
  }
  </code></pre>
  
  <p>is there better way to find and iterate over list (to click based on text() of elements?)</p>
  
  <p>thx</p>