如何从Selenium Web驱动程序的下拉列表中选择出生日期?这是我尝试过的:
Select oSelect = new Select(driver. findElement(By.id("month"))).click();
答案 0 :(得分:0)
首先应选择下拉元素
Select oSelect = new Select(driver.findElement(By.id("month")))
现在,任何选择方法都可以像
那样使用oSelect.selectByVisibleText("February") // or
oSelect.selectByIndex(1) // or
oSelect.selectByValue(value attribute of the element to be selected)