title: For loop for Checking list of items in Selenium WebDriver
body: <p>I have written below code for Checking list Web Elements, but below code is running but for only 1st item its no looping to end of loop.</p>
  
  <pre><code>List &lt;WebElement&gt; listofItems = wd.findElements(By.xpath("//*[starts-with(@id,'result_')]//div//div[1]//div//a//img"));
  
  for (int i=1; i&lt;=listofItems.size(); i++)
  {
     listofItems.get(i).click();
     wd.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
     System.out.println(i);
     System.out.println("pass");
     wd.navigate().back();
  }
  </code></pre>