想要打印搜索输出列表

时间:2016-11-14 08:23:52

标签: java selenium

WebElement dropDown = driver.findElement(By.id("list_bus_suggestion"));

Select suggestionList = new Select(dropDown);

List<WebElement> allOptions = suggestionList.getOptions();

for (int i = 0; i < allOptions.size(); i++) {
    String drop_down_values = allOptions.get(i).getText();

    System.out.println("dropdown values are " + drop_down_values);
}

错误显示在select语句中,

  

org.openqa.selenium.support.ui.UnexpectedTagNameException:元素应该是“select”但是“android.widget.ExpandableListView”

0 个答案:

没有答案