title: For loop not only passing once
body: <pre><code>      String[] expected = new String[10];
      //{"Acapulco","Frankfurt","London","New York","Paris","Portland","San Francisco","Seattle","Sydney","Zurich"};
      expected[0] = "Acapulco";
      expected[1] = "Frankfurt";
      expected[2] = "London";
      expected[3] = "New York";
      expected[4] = "Paris";
      expected[5] = "Portland";
      expected[6] = "San Francisco";
      expected[7] = "Seattle";
      expected[8] = "Sydney";
      expected[9] = "Zurich";
  
      List&lt;WebElement&gt; allOptions = driver.findElements(By.name("fromPort"));
  
  
   // match the fromPort list value against the expected Array
      for (int i = 0  ; i &lt; (expected.length) &amp;&amp; i &lt; allOptions.size(); i++) {
  
           String optionValue = allOptions.get(i).getAttribute("value");
  
           if (optionValue.equals(expected[i])) {
               System.out.println("PASSED on: " + optionValue + " we had: "+ expected[i] );
           } 
  
           else {
               System.out.println("FAILED on: " + optionValue + " we expected: " + expected[i]);
           }
   }
      //close Firefox
      driver.close();
  </code></pre>
  
  <p>When executing the loop is only going round once then it exists... So it executes: 
      PASSED on: Acapulco we had: Acapulco
  then exits the loop...</p>
  
  <p>This is following on from my other comment: <a href="https://stackoverflow.com/questions/30888117/outofboundsexception-why/30888436#30888436">My Other Comment</a></p>
  
  <p>New to all this Java and Selenium....</p>
  
  <p>I am assuming its something to do with the Size of it only being 1; but not sure how to increase/overcome this</p>
  
  <p>HTML snippet added as requested in comments:</p>
  
  <pre><code>&lt;tr&gt;
  
  &lt;td align="right"&gt;
      &lt;font face="Arial, Helvetica, sans-serif" size="2"&gt;
          &lt;b&gt;
  
              Departing 
                            From: 
  
          &lt;/b&gt;
      &lt;/font&gt;
  &lt;/td&gt;
  &lt;td&gt;
      &lt;select name="fromPort"&gt;
          &lt;option value="Acapulco"&gt;&lt;/option&gt;
          &lt;option value="Frankfurt"&gt;&lt;/option&gt;
          &lt;option value="London"&gt;&lt;/option&gt;
          &lt;option value="New York"&gt;&lt;/option&gt;
          &lt;option value="Paris"&gt;&lt;/option&gt;
          &lt;option value="Portland"&gt;&lt;/option&gt;
          &lt;option value="San Francisco"&gt;&lt;/option&gt;
          &lt;option value="Seattle"&gt;&lt;/option&gt;
          &lt;option value="Sydney"&gt;&lt;/option&gt;
          &lt;option value="Zurich"&gt;&lt;/option&gt;
      &lt;/select&gt;
  </code></pre>