TA的每日心情 | 开心 2015-3-26 13:17 |
---|
签到天数: 48 天 连续签到: 1 天 [LV.5]测试团长
|
//使用新地址
System.out.println("使用新地址");
wait = new WebDriverWait(Driver, 5);
wait.until(ExpectedConditions.presenceOfElementLocated(By.id("consignee_radio_new")));
Driver.findElement(By.id("consignee_radio_new")).click();
//选择省份
System.out.println("选择省份");
wait.until(ExpectedConditions.presenceOfElementLocated(By.id("consignee_province")));
Thread.sleep(2000);
Select select = new Select(Driver.findElement(By.xpath("//div[@class='consignee-form']/div[2]//select[@id='consignee_province']")));
select.selectByValue("19");
//select.selectByIndex(2);
//选择城市
System.out.println("选择城市");
Thread.sleep(1000);
select = new Select(Driver.findElement(By.id("consignee_city")));
select.selectByValue("1607");
//选择地区
System.out.println("选择地区");
Thread.sleep(1000);
select = new Select(Driver.findElement(By.id("consignee_county")));
select.selectByValue("3155");
主要是加等待,可能元素没有更新出来 |
|