Help needed wit the XPath statement for Selenium test
Posted
by mgeorge
on Stack Overflow
See other posts from Stack Overflow
or by mgeorge
Published on 2010-06-02T07:53:59Z
Indexed on
2010/06/02
8:53 UTC
Read the original article
Hit count: 306
I am testing a calendar component using selenium.In my test i want to click on the current date.Please help me with the XPath statement for doing that.I am adding the HTML for the calender component
<input id="event_date" type="text" on="click then l:show.event.calendar" style="border: 1px solid rgb(187, 187, 187); width: 100px;" fieldset="new_event" decorator="redbox" validator="date"/>
<img id="app_136" style="position: relative; top: 2px;" on="click then l:show.event.calendar" src="images/calendar.png"/>
<div id="app_137" style="margin: 0pt; padding: 0pt;">
<div id="app_calendar_2" class="yui-calcontainer single withtitle" style="position: absolute; z-index: 1000;">
<div class="title">Select Event Date</div>
<table id="app_calendar_2_cal" class="yui-calendar y2010" cellspacing="0">
<thead>
<tr>
</tr>
<tr class="calweekdayrow">
<th class="calweekdaycell">Su</th>
<th class="calweekdaycell">Mo</th>
<th class="calweekdaycell">Tu</th>
<th class="calweekdaycell">We</th>
<th class="calweekdaycell">Th</th>
<th class="calweekdaycell">Fr</th>
<th class="calweekdaycell">Sa</th>
</tr>
</thead>
<tbody class="m6 calbody">
<tr class="w22">
<td id="app_calendar_2_cal_cell0" class="calcell oom calcelltop calcellleft">30</td>
<td id="app_calendar_2_cal_cell1" class="calcell oom calcelltop">31</td>
<td id="app_calendar_2_cal_cell2" class="calcell wd2 d1 selectable calcelltop">
</td>
<td id="app_calendar_2_cal_cell3" class="calcell wd3 d2 today selectable calcelltop selected">
<a class="selector" href="#">2</a>
</td>
I want to click the date component described in
<td id="app_calendar_2_cal_cell3" class="calcell wd3 d2 today selectable calcelltop selected">
<a class="selector" href="#">2</a>
</td>
Thanks in advance
mgeorge
© Stack Overflow or respective owner