title: Choose elements one by one in dropdown list with Selenium Webdriver
body: <p>I'm trying to choose elements in "Category" one-by-one on <a href="http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCellTable" rel="nofollow noreferrer">this page</a> with:</p>
  
  <pre><code>WebElement category = new WebDriverWait(driver, 10)
                  .until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.cssSelector("tr[__gwt_row='" + rowIndex + "'] &gt; td &gt; div")))
                  .get(3);
  
          category.click();
          category.findElement(By.tagName("select")).sendKeys("Businesses");
          category.click();
          category.findElement(By.tagName("select")).sendKeys("Contacts");
  </code></pre>
  
  <p>Throwing this : "stale element reference: element is not attached to the page document"</p>
  
  <p>Maybe exists some another way to do it?</p>
  
  <p>UPD: 
  It works if i do this:</p>
  
  <pre><code> WebElement categoryBusinesses = new WebDriverWait(driver, 10)
                  .until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.cssSelector("tr[__gwt_row='" + rowIndex + "'] &gt; td &gt; div")))
                  .get(3);
  
          categoryBusinesses.findElement(By.tagName("select")).sendKeys("Businesses");
  
   WebElement categoryContacts = new WebDriverWait(driver, 10)
                  .until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.cssSelector("tr[__gwt_row='" + rowIndex + "'] &gt; td &gt; div")))
                  .get(3);
  
          categoryContacts.findElement(By.tagName("select")).sendKeys("Contacts");
  </code></pre>
  
  <p>But is it a right way?</p>
  
  <p>UPD2: 
  I also tried this:</p>
  
  <pre><code> WebElement element = categoryBusinesses.findElement(By.tagName("select"));
          Select category = new Select(element);
          category.selectByIndex(0);
          category.selectByIndex(1);
  </code></pre>
  
  <p>But it not works.</p>