title: How to select date in Datepicker using selenium?
body: <p>i want to know how we can select element for start date and end date in a datepicker.
  I tried this:</p>
  
  <pre><code>driver.findElement(By.cssSelector("span.add-on &gt; i.enticon-calendar")).click();    driver.findElement(By.xpath("//div[@id='sizcache0696532219872199']/div/table/tbody/tr[5]/td[7]")).click();
  </code></pre>
  
  <p>but it did not find the the second element with sizcache0696532219872199.</p>
  
  <p>How can i select End date and Start date?please any help, thank you.</p>
  
  <p>here is html code:</p>
  
  <pre><code>&lt;div class="control-group"&gt;
  
      &lt;label class="control-label"&gt;
  
          StartDate
  
      &lt;/label&gt;
      &lt;div class="controls"&gt;
          &lt;div class="input-append date datepicker-start" data-date-format="yyyy-mm-dd"&gt;
              &lt;input class="span2 start-date" type="text" value="" placeholder="YYYY-MM-DD" size="16" name="start"&gt;&lt;/input&gt;
              &lt;span class="add-on"&gt;
                  &lt;i class="enticon-calendar"&gt;&lt;/i&gt;
              &lt;/span&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  &lt;div class="control-group"&gt;
  
      &lt;label class="control-label"&gt;
  
          EndDate
  
      &lt;/label&gt;
      &lt;div class="controls"&gt;
          &lt;div class="input-append date datepicker-end" data-date-format="yyyy-mm-dd" data-date=""&gt;
              &lt;input class="span2 end-date" type="text" value="" placeholder="YYYY-MM-DD" size="16" name="end"&gt;&lt;/input&gt;
              &lt;span class="add-on"&gt;
                  &lt;i class="enticon-calendar"&gt;&lt;/i&gt;
              &lt;/span&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>