title: selenium webdriver java dropdown box
body: <p>need some help on this. Trying to learn Java and selenium at the same time isn't good but has to be done :( </p>
  
  <p>I am trying to test a drop down spots box which contains: </p>
  
  <pre><code>&lt;select name="sport" id="sport"&gt;
   &lt;option value="1"&gt;Soccer&lt;/option&gt;
   &lt;option value="2"&gt;Basketball&lt;/option&gt;
   &lt;/select&gt;
  </code></pre>
  
  <p>I want to perform the follow: 
  1: Assert box is present and its text is Soccer and Basketball 
  2: Click Basketball and then click Soccer again. 
  3: Assert the changes in the table below this box. (Have this done I think but need the above) </p>
  
  <p>Code so far: </p>
  
  <pre><code>    Select sportDropdown = new Select(webBrowser.findElement(By.id("sport")));
      sportDropdown.selectByVisibleText("Soccer");
      assertEquals(sportDropdown, "Soccer");
  </code></pre>
  
  <p>Error received: </p>
  
  <p>java.lang.AssertionError: 
  Expected :org.openqa.selenium.support.ui.Select@278806c4
  Actual   :Soccer</p>
  
  <p>I have no idea where this "Expected " value is coming from so any pointers would be great folks. </p>
  
  <p>Note this is all in Java so please refrain from submitting code help in C#. Makes my life harder :( </p>
  
  <p>Thanks
  J</p>