<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>
我想選擇和期權選擇選項
硒的webdriver代碼
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]
選擇方式點擊右鍵? –