定位下拉框,查看HTML,带有select标签
//下拉框选择上海
WebElement province = driver.findElement(By.cssSelector("select[id='companyprovince']"));
Select selectProvince = new Select(province);
selectProvince.selectByVisibleText("上海");
select.selectByValue("2");
select.selectByIndex(2);
————————————————————————
selectByValue:参数为option中的value属性
selectByIndex:参数为option的顺序
selectByVisibleText:参数为option的text值