我需要为 element 确定 xpath 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>
我试过了
selenium.click("//input[@id='mainForm:queryConfigure:fetchReport'][@type='image'][@src='images/show_report.gif']");
和
selenium.click("//input[@id='mainForm:queryConfigure:fetchReport']");
还有一个案例:
<div class="tabUnselectedText" align="center">
<a href="javascript:renderPage('mainForm:consoleBeanId.1','Notifications', 'notifications.faces');">Notifications</a>
</div>