title: Getting error "java.lang.IndexOutOfBoundsException: Index: 1, Size: 1" when trying to select second option from the drop down list
body: <p>I want to select the third option from the drop down list. Drop down list is written in the <code>div</code> tag. I am only getting the size of drop down list as 1 but there are total 10 items in the drop down. Below is the Selenium code :</p>
  <pre class="lang-java prettyprint-override"><code>driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
  driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);
  
  // Clicking the drop down list
  element = driver.findElement(By.xpath(&quot;//div[@class='selectedItem']&quot;));
  element.click();
  
  // Here I am trying to fetch all options in the drop down list.
  List&lt;WebElement&gt; options= driver.findElements(By.xpath(&quot;//div[@class='dropdownItems open']&quot;));  
  int size = options.size();
  
  //There are 10 items in the drop down list but I am getting only one as a result.
  System.out.println(size);
  
  //Here I am getting the error for &quot;Out of Bound&quot;
  options.get(1).click();
  
  Thread.sleep(5000);
  </code></pre>