title: How do I iterate multiple List<WebElement> in selenium /Java
body: <p>I have the following WebElement List in a page</p>
  
  <pre><code>@FindBy(xpath="a")
  
  private List&lt;WebElement&gt; generalList ;
  
  @FindBy(xpath="b")
  
  private List&lt;WebElement&gt; eventList ;
  
  @FindBy(xpath="c")
  
  private List&lt;WebElement&gt; additionalList ;
  </code></pre>
  
  <p>I want to iterate each of the above list items and apply clear through a loop instead of writing the following way which currently works</p>
  
  <pre><code>for(WebElement type:generalList)
  type.clear();
  for(WebElement type:eventList)
  type.clear();
  for(WebElement type:additionalList)
  type.clear();
  </code></pre>