List nines=driver.findElements(By.xpath(("//select[contains(@id,'ddlIN_HH'(]"(;
for(WebElement nine : nines)
{ Select s= new Select(nine);
s.selectByValue("09");
}
您可以使用xpath函数position((直接选择前5个元素所以你的新xpath是
List nines=driver.findElements(By.xpath(("//select[contains(@id,'ddlIN_HH')]")[position() < 6]));