title: How to find the selected option of a Dropdown?
body: <p>How do we find the selected option of a Dropdown in Selenium Webdriver??</p>
  
  <p>I tried -</p>
  
  <pre><code>WebElement element = driver.findElement(By.xpath(locator1));
  Select select = new Select(element);
  List&lt;WebElement&gt; SO = select.getAllSelectedOptions();
  String S = SO.toString();
  System.out.println(S);
  </code></pre>
  
  <p>which returns WebElements like - </p>
  
  <pre><code>[[[[[FirefoxDriver: firefox on XP (c388e8a8-09d5-41b9-b086-0278c639d8b1)] -&gt; xpath: .//*[@id='city']]] -&gt; tag name: option]]
  </code></pre>
  
  <p>I want to find the option that is selected?</p>