title: Selenium webdriver : <WebElement> Iterator cannot be resolved to a type
body: <p><strong>My Problem in brief</strong> :</p>
  <p>Through My selenium web driver right now i am testing list of elements in a list box , While using the following code i am getting the error</p>
  <p><strong>Testing Configuration</strong> :</p>
  <ul>
  <li>Mozilla firefox</li>
  <li>Eclipse Indigo</li>
  <li>Selenium Webdriver 2</li>
  </ul>
  <p><strong>Scenario which i tested</strong> :</p>
  <ol>
  <li>Open website</li>
  <li>Select and display the list box items</li>
  <li>Write to console</li>
  </ol>
  <p><strong>My error</strong> :</p>
  <blockquote>
  <p>java.lang.Error: Unresolved compilation problems: The type List is not generic; it cannot be parameterized with arguments  Iterator cannot be resolved to a type</p>
  </blockquote>
  <p><strong>My Code</strong> :</p>
  <pre class="lang-java prettyprint-override"><code>package com.example.tests;
  
  import java.util.Iterator;
  import java.util.regex.Pattern;
  import java.util.concurrent.TimeUnit;
  import org.junit.*;
  import static org.junit.Assert.*;
  import static org.hamcrest.CoreMatchers.*;
  import org.openqa.selenium.WebElement;
  import org.openqa.jetty.html.List;
  import org.openqa.selenium.*;
  import org.openqa.selenium.firefox.FirefoxDriver;
  import org.openqa.selenium.support.ui.Select;
  import com.browsersetup.test.BrowserSetup;
  import org.testng.*;
  import org.testng.annotations.*;
  import org.testng.annotations.Test;
  
  @SuppressWarnings(&quot;unused&quot;)
  public class sample2 extends BrowserSetup{
      private boolean acceptNextAlert = true;
      private StringBuffer verificationErrors = new StringBuffer();
  
      @BeforeClass
      public void setUp() throws Exception {
          driver = new OperaDriver();
          baseUrl = &quot;http://www.ebay.com/&quot;;
          driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
          System.out.println(&quot;Browser = &quot; + driver);
          System.out.println(&quot;Base URL = &quot; + baseUrl);
      }
  
      @Test
      public void testUntitled() throws Exception {
          driver.get(baseUrl + &quot;/&quot;);
          Thread.sleep(10000);
          WebElement element = driver.findElement(By.name(&quot;_sacat&quot;));
          Select dd= new Select(element);
          List&lt;WebElement&gt; allOptions= dd.getOptions();
  
          //To go through the list, we can use an Iterator. 
          //Iterator should be of the same type as the List
          //which is WebElement in this case.
  
          Iterator&lt;WebElement&gt; it = allOptions.iterator();
          //Using while loop, we can iterate till the List has 
          //a next WebElement [hasNext() is true]
          //number of items in the list
          System.out.println(allOptions.size());
  
          while(it.hasNext()){
              //When you say it.next(), it points to a particular
              //WebElement in the List.
              WebElement el = it.next();
               //Check for the required element by Text and click it
          if(el.getText().equals(&quot;mango&quot;)){
              System.out.println(el.getAttribute(&quot;value&quot;));
              el.click();
          }
      }
  
      @AfterClass
      public void tearDown() throws Exception {
          driver.quit();
          String verificationErrorString = verificationErrors.toString();
          if (!&quot;&quot;.equals(verificationErrorString)) {
              fail(verificationErrorString);
          }
      }
  
      private boolean isElementPresent(By by) {
          try {
              driver.findElement(by);
              return true;
          } catch (NoSuchElementException e) {
              return false;
          }
      }
  
      private boolean isAlertPresent() {
          try {
              driver.switchTo().alert();
              return true;
          } catch (NoAlertPresentException e) {
              return false;
          }
      }
  
      private String closeAlertAndGetItsText() {
          try {
              Alert alert = driver.switchTo().alert();
              String alertText = alert.getText();
              if (acceptNextAlert) {
                  alert.accept();
              } else {
                  alert.dismiss();
              }
              return alertText;
          } finally {
              acceptNextAlert = true;
          }
      }
  }
  </code></pre>
  <p>I dont know where it went wrong,guide me where it went wrong</p>
  <p>thanks in advance</p>