我有代碼:硒的webdriver與Java - 如何添加 「其他」 條件
public void setList(By localizator, String v_value {
Select some_list = new Select(driver.findElement(localizator));
for(WebElement position_list : some_list.getOptions()) {
if(position_list.getText().equalsIgnoreCase(v_value)) {
some_list.selectByVisibleText(position_list.getText());
break;
}
}
}
如何添加條件:如果硒沒有找到position_list.getText()equalsIgnoreCase(v_value),然後系統。拋出新的RuntimeExpression?