tags:

views:

17

answers:

1

I need to detemine xpath for element mainForm:queryConfigure:fetchReport.

<span id="mainForm:queryConfigure:j_id18">
<table id="mainForm:queryConfigure:j_id19"
       class="showReportTable" align="center">
<tbody>
<tr>
<td>
<input id="mainForm:queryConfigure:fetchReport" type="image"
       src="images/show_report.gif" name="mainForm:queryConfigure:fetchReport"/>
</td>
</tr>
</tbody>
</table>
</span>

I tried

selenium.click("//input[@id='mainForm:queryConfigure:fetchReport'][@type='image'][@src='images/show_report.gif']");

and

selenium.click("//input[@id='mainForm:queryConfigure:fetchReport']");

One more case:

<div class="tabUnselectedText" align="center">
<a href="javascript:renderPage('mainForm:consoleBeanId.1','Notifications', 'notifications.faces');">Notifications</a>
</div>
A: 

Id and name attribute values are acceptable locators for method click. See locating elements in the documentation.

selenium.click('mainForm:queryConfigure:fetchReport');
Lachlan Roche