title: How to write code to compare the drop down options in selenium
body: <p>i have an UI where drop down are present with 20,50,100,500,1000 values.20 is the default value.I need to write the selenium java code to fetch the values and compare it.below is the code i have written.</p>
  
  <pre><code>  WebElement show = driver.findElement(By.xpath(".//*[@id='revtable_length']/label"));
          Select sel= new Select(show); 
          List &lt;WebElement&gt; option= sel.getOptions(); 
          //sAssert.assertEquals(show,"Show20501005001000 entries","retrieve table dropdown button is not present");
          for (int i= 0; i&lt; option.size(); i++)![enter image description here][1]
          System.out.print((option.get(i)).getText());
  </code></pre>
  
  <p>but i am getting the error:</p>
  
  <pre><code>org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been "select" but was "label"
  Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-27 00:00:10'
  System info: host: 'bionicps0000574', ip: '167.209.185.85', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_20'
  Driver info: driver.version: unknown
  </code></pre>