Can someone help me figure out how to select elements for the start date and end date in a datepicker? I've tried the following:
driver.findElement(By.cssSelector("span.add-on > i.enticon-calendar")).click(); driver.findElement(By.xpath("//div[@id='sizcache0696532219872199']/div/table/tbody/tr[5]/td[7]")).click();
However, I couldn't locate the second element with sizcache0696532219872199.
Any advice on how to select the End Date and Start Date properly would be much appreciated. Thank you!
Here is the HTML code:
<div class="control-group">
<label class="control-label">
StartDate
</label>
<div class="controls">
<div class="input-append date datepicker-start" data-date-format="yyyy-mm-dd">
<input class="span2 start-date" type="text" value="" placeholder="YYYY-MM-DD" size="16" name="start"></input>
<span class="add-on">
<i class="enticon-calendar"></i>
</span>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">
EndDate
</label>
<div class="controls">
<div class="input-append date datepicker-end" data-date-format="yyyy-mm-dd" data-date="">
<input class="span2 end-date" type="text" value="" placeholder="YYYY-MM-DD" size="16" name="end"></input>
<span class="add-on">
<i class="enticon-calendar"></i>
</span>
</div>
</div>
</div>