0

我需要为 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>
4

1 回答 1

0

Id 和 name 属性值是 method 可接受的定位器click。请参阅文档中的定位元素

selenium.click('mainForm:queryConfigure:fetchReport');
于 2010-03-29T12:53:58.657 回答