<tr role="row" class="odd">
<td class="sorting_1">Abrar</td>
<td>1571</td>
<td>Out</td>
<td>No</td>
<td>ALL</td>
<td>Deskflex</td>
<td>
<a class="btn" href="/override/OverUserOverRide/21801" style="font-size: 15px;"><span class="glyphicon glyphicon-user"></span></a>
</td>
</tr>
IWebElement t = driver.FindElement(By.XPath("//*table[@id='customerDatatable']"));
t.FindElement(By.CssSelector("a[href='/override/OverUserOverRide/21801']")).Click();
我已經使用了此代碼,但無法正常作業。關聯
uj5u.com熱心網友回復:
問題出在第一個元素t定位器中,因為它不是有效的。
//*table[@id='customerDatatable']
您應該使用 * (用于在所有標簽中搜索)或特定的 TagName (在您的情況下是表),因此它可能是:
//*[@id='customerDatatable']
或者
//table[@id='customerDatatable']
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/315544.html
