<table id="rusTable" class="groupTable" cellspacing="0" cellpadding="0">
<tbody class="ui-sortable" style="">
<tr class="groupTop ruBorder" style="display: table-row;">
<tr id="ru0" class="siru">
<tr class="ruOp off">
<td class="first"></td>
<td colspan="3">
<select class="ruOpSelect">
<option></option>
<option value="AND">AND</option>
<option>AND NOT</option>
<option>OR</option>
</select>
</td>
<td class="last"></td>
</tr>
<tr id="ru1" class="siru">
<tr class="ruOp off">
<td class="first"></td>
<td colspan="3">
<td class="last"></td>
</tr>
<tr id="ru2" class="siru">
<tr class="groupBtm ruBorder" style="display: table-row;">
</tbody>
<tfoot>
</table>
我想选择 AND 选项
Selenium 网络驱动程序代码
actions.moveToElement(driver.findElement(By.xpath("//*@id='ruTable']/tbody/tr[3]/td[2]"))).build().perform();
waitForElement(By.xpath("(//*[@id='ruTable']//*[contains(@class,'ruOpSelect')])[1]"),30);
new Select(driver.findElement(By.xpath("(//*[@id='ruTable']//*[contains(@class,'ruOpSelect')])[1]"))).selectByVisibleText("AND");
它会执行悬停动作,但不会从下拉菜单中选择任何内容
错误 - 等待 By.xpath 定位的元素可见性 30 秒后超时
:(//*[@id='ruTable']//*[contains(@class,'ruOpSelect')])[1]