0
在selenium中如何點擊表中嵌入的超鏈接,在這裏我要點擊鏈接,這個鏈接是在數據表的第一個條目。在Selenium中如何點擊表中嵌入的超鏈接
<table class="table table-bordered">
<thead>
<tr></tr>
</thead>
<tbody>
<tr class="ng-scope" ng-repeat="item in view_data">
<td>
<a class="ng-binding" title="Click to View Agent Profile" ng-href="#/agent/profile/46" href="#/agent/profile/46"></a>
</td>
<td class="ng-binding">
1000008
</td>
<td class="ng-binding"></td>
<td class="ng-binding"></td>
<td class="ng-binding"></td>
<td class="ng-binding"></td>
<td class="ng-binding"></td>
<td></td>
</tr>
<tr class="ng-scope" ng-repeat="item in view_data"></tr>
<tr class="ng-scope" ng-repeat="item in view_data"></tr>
<tr class="ng-scope" ng-repeat="item in view_data"></tr>
<tr class="ng-scope" ng-repeat="item in view_data"></tr>
</tbody>
</table>
我想下面的代碼,但它不工作..
WebElement tableLink = driver
.findElement(By
.xpath("//*table[@class='table table-bordered']/thead/tbody tr[@id='ng-scope']/td[@class='ng-binding']/a"));
tableLink.click();
你能分享哪個網站?或者頁面的DOM層次結構? – sheeptest 2014-09-27 12:32:27